“Error: You may not call store.getState() while the reducer is executing.”

后端 未结 10 1648
囚心锁ツ
囚心锁ツ 2020-12-07 21:41

I just upgraded my fully functional react-native app to Redux v4, but now I am getting the following error:

Error: Error: Error: Error: You may not call

10条回答
  •  离开以前
    2020-12-07 22:29

    In my case, I have to remove composeWithDevTools - a plugin for chrome

    import { createStore, combineReducers, applyMiddleware } from 'redux';
    import { composeWithDevTools } from 'redux-devtools-extension';
    import thunk from 'redux-thunk';
    
    // const enhancer = composeWithDevTools(applyMiddleware(thunk))
    const enhancer = applyMiddleware(thunk)
    
    const store = createStore(reducers, enhancer);
    

提交回复
热议问题