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

后端 未结 10 1668
囚心锁ツ
囚心锁ツ 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:28

    It's an issue with the new v2.16.0 release of redux-devtools-extension.

    Here's a couple of workaround while we wait for the fix...

    1. Revert back to the working version v2.15.5 (For Chrome)

      • Download https://github.com/zalmoxisus/redux-devtools-extension/releases/download/2.15.5/extension.zip
      • Extract the zip
      • Type chrome://extensions into the url and toggle on developer mode on the top right of the page.
      • The button Load Unpacked will appear. After clicking the button, select the extracted folder.
    2. Or just simply disable your redux-devtool extension for now.

      • either on the browser level or through your code(where you create the redux store)

    FYI: this does not solve the OP's question but does solve the issue where developers are receiving the below error message starting 11/27/18.

    Error: You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.


    UPDATE

    v2.16.2 has been released

    For those who had previously disabled the extension, just re-enable it and Update your redux dev tools from 2.16.0 to 2.16.2 Update Redux Dev tools

提交回复
热议问题