【问题标题】:You may not call store.getState()您可能不会调用 store.getState()
【发布时间】:2018-11-28 16:45:31
【问题描述】:

正如标题所说。我加了

// Create Store
const store = createStoreWithFirebase(
rootReducer,
initialState,
composeWithDevTools(reactReduxFirebase(firebase))
);

这在没有安装 redux 扩展的浏览器中可以正常工作。 IE safari,铬隐身。当我尝试运行安装了扩展程序的站点时,我得到了。

错误:你不能在 reducer 执行时调用 store.getState()。 reducer 已经接收到状态作为参数。从顶部 reducer 向下传递,而不是从 store 中读取。

如果我改变了

composeWithDevTools()

compose()

应用程序运行良好。

我该如何解决这个问题?

【问题讨论】:

标签: reactjs google-chrome redux google-chrome-devtools


【解决方案1】:

正如用户 Victor Le 在其他帖子中评论的那样: "Error: Error: Error: Error: You may not call store.getState() while the reducer is executing." ?

这是 redux-devtools-extension 的新 v2.16.0 版本的问题。 只需禁用它,不要使用它或降级到 v2.15。

上面的帖子真的很有用。

最好的!

【讨论】:

  • 最好将其标记为重复,而不是发布问题链接。
猜你喜欢
  • 2019-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-10-17
  • 2017-09-08
  • 1970-01-01
  • 2021-08-05
相关资源
最近更新 更多