请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

Type 'unknown' is not assignable to type 'AnyAction

ERROR in src/context/auth-context.tsx:57:9

TS2322: Type ‘Dispatch’ is not assignable to type ‘(…args: unknown[]) => Promise’.
Types of parameters ‘action’ and ‘args’ are incompatible.
Type ‘unknown’ is not assignable to type ‘AnyAction’.
55 |
56 | export const useAuth = () => {

57 | const dispatch: (…args: unknown[]) => Promise = useDispatch()
| ^^^^^^^^
58 | const user = useSelector(selectUser)
59 | const login = useCallback((form: AuthForm) => dispatch(authStore.login(form)), [dispatch])
60 | const register = useCallback((form: AuthForm) => dispatch(authStore.register(form)), [dispatch]

正在回答 回答被采纳积分+3

2回答

慕的地4513948 2022-09-21 19:08:46

我也遇到同样的问题


0 回复 有任何疑惑可以回复我~
丁锅锅 2022-06-02 19:26:37

我也遇到了一样的问题

0 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号