React: Unhandled Rejection (TypeError): dispatch不是一个函数(匿名函数)



我得到一个错误的反应回来的例如:' .catch((err) =>{调度({类型:POST_ERROR,有效载荷:{msg: error .response。status: error .response.status};}(;}(;

};'问题在哪里?

你能分享一下你的整个组件吗?

如果你使用钩子,你可能会错过const dispatch = useDispatch();

如果你在"class"模式时,该功能可从存储store.dispach()

中获得。https://redux.js.org/tutorials/fundamentals/part-2-concepts-data-flow调度

最新更新