我即将为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
)中。
您也不需要模块。无论何处创建商店都定义composeEnhancers
功能并将其应用于中间件:
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose
const store = createStore(
...reducers,
...initialState,
composeEnhancers(
...middleware
)
)