我越來越終極版,簡單的路由器+反應路由器錯誤 「路由狀態不存在」
Uncaught Error: Cannot sync router: route state does not exist. Did you install the routing reducer?
代碼:
減速器/ index.js:
const rootReducer = {
counter,
exampleData,
navigation,
};
const reducer = combineReducers(Object.assign({}, rootReducer, {
routing: routeReducer
}))
//const reducer = combineReducers(rootReducer);
export default reducer
and
app.jsx:
var __DEBUG__ = __DEBUG__ || false;
var __DEBUG_NW__ = __DEBUG_NW__ || false;
const target = document.getElementById('app');
const history = createBrowserHistory();
const store = configureStore(window.__INITIAL_STATE__, __DEBUG__);
syncReduxAndRouter(history, store);
const node = (
<Root
history={history}
store={store}
debug={__DEBUG__}
debugExternal={__DEBUG_NW__}
/>
);
ReactDOM.render(node, target);
該錯誤是由syncReduxAndRouter調用觸發的,但我沒有看到我做錯了什麼。 我需要做什麼才能正確使用redux-simple-router? (此外,有助於澄清問題將不勝感激)
(編輯感謝:@knowbody) –