无法解析模块remote-redux-devtools

时间:2017-02-21 12:05:38

标签: reactjs react-native react-redux redux-devtools

我即将为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)。

1 个答案:

答案 0 :(得分:0)

您也不需要这个模块。无论您在何处创建商店,都要定义composeEnhancers函数并将其应用于您的中间件:

const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose

const store = createStore(
  ...reducers,
  ...initialState,
  composeEnhancers(
    ...middleware
  )
)