1

我即将为 react-native 应用程序设置远程调试。我添加了remote-redux-devtools模块并导入了它。有谁知道为什么我会收到以下错误: UnableToResolveError: Unable to resolve module remote-redux-devtools from /Users/.../src/store/createStore.js: Module does not exist in the module map or in these directories:....

它位于node_modules目录 ( node_modules/remote-redux-devtools) 中。

4

1 回答 1

0

您也不需要为此使用模块。无论您在哪里创建商店,都定义一个composeEnhancers函数并将其应用到您的中间件:

const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose

const store = createStore(
  ...reducers,
  ...initialState,
  composeEnhancers(
    ...middleware
  )
)
于 2017-02-21T18:22:45.987 回答