我正在尝试将我的应用程序配置为使用 redux-devtools,但它无法正常工作。
这是我在使用 redux-devtools 之前的配置
var persistedState = loadState();
var createStoreWithMiddleware = compose(applyMiddleware(thunk,loadingBarMiddleware(),errorBarMiddleware()),reduxReset())(createStore);
export var store = createStoreWithMiddleware(reducers,persistedState);
这是我使用 redux-devtools 所做的
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
var createStoreWithMiddleware = compose(applyMiddleware(thunk,loadingBarMiddleware(),errorBarMiddleware()),reduxReset())(createStore);
const store = createStore(reducers, /* preloadedState, */ composeEnhancers(
createStoreWithMiddleware(reducers,persistedState)
));
但是有了这个我得到了错误
Uncaught TypeError: reducer is not a function
那么,我在哪里错了?