在过去的几天里,我已经搜索了无数个小时,试图自己解决这个问题,但没有结果……我有一个非常简单的thunk,但实际的调度永远不会调用...
这是动作创建者:
const startSurvey = () => {
console.log("inside startSurvey thunk")
return (dispatch, getState) => {
console.log("inside startSurvey thunk func")
}
}我能看到的第一个日志,从来不是第二个。我已经正确设置了我的商店(我想)
export const configureStore = (onComplete: ?() => void) => {
return createStore(rootReducer, applyMiddleware(thunk))
}发布于 2016-05-20 15:36:24
好了,解决了!我是通过按钮上的简单onPress处理程序调用操作创建器,而不是分派它!这是一个多么新手的错误,但我花了好几个小时,@ helped on discords才帮到我!
https://stackoverflow.com/questions/37340273
复制相似问题