我收到此错误:
意外的键“dispatch”,“subscribe”,“getState”,“replaceReducer”,“liftedStore”在preloadedState参数中找到传递给createStore。预计会找到一个已知的reducer键:“form”。意外的键将被忽略。
我的新redux商店,应用中间件是:
// redux extension
const composeEnhancer = window.__REDUX_DEVTOOLS_EXTENSION__ || compose;
const enhancer = composeEnhancer(applyMiddleware(promiseMiddleware()));
const store = createStore(reducer, enhancer);
我遵循了这里的指导方针:https://github.com/zalmoxisus/redux-devtools-extension
用__REDUX_DEVTOOLS_EXTENSION__
替换__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
。前者是一个完整的增强器,如果你没有使用任何中间件或增强器,你可以直接传递给createStore
。后者是你正在寻找的组合功能。