[英]Redux Thunk return dispatch not working
using Redux Thunk, first log 'OK' is OK, but process doesn't go to second console.log. 使用Redux Thunk,首先登录'OK'即可,但是进程不会进入第二个console.log。
Anyone knows what's wrong? 谁知道什么是错的? Thank you
谢谢
export const postTweet = (body) => {
console.log('OK')
return dispatch => {
console.log('NO LOG')
}
}
You should do dispatch(postTweet(body))
. 你应该
dispatch(postTweet(body))
。 just calling postTweet
like postTweet(body) from component doesn't the trick. 只是从组件中调用
postTweet
就像postTweet(body)一样。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.