I am creating an isomorphic code-breaking application using a responsive router and reduct. I have been as far as I can, but I need help to figure out the rest of my problem. I have a large application that requires code separation for an interface. I have a gearbox registry that allows me to register new gearboxes (lazy loaded) or replace existing gearboxes in my store. This works fine, however, since sections of my application are lazy loaded, my lazy loaded reducers are missing when I call combReducers () on the client side, while they are perfectly resolved on the server. This causes an unexpected key error and causes my store to ignore the abusive key (s) in my initial state.
initialState (from server)
{ "cases": {...}, "user": {...} }
Client side redux expected initialState
It is based on affordable gearboxes.
{ "user": {...} }
Loaded gear
Lazy loaded reducer
An error occurs when I call the following
const finalCreateStore = compose( applyMiddleware(promiseMiddleware) )(createStore); const rootReducer = combineReducers({...reducers}) const store = finalCreateStore(rootReducer, initialState);
An unexpected key βcaseβ found in the initialState argument passed to createStore. Instead, you are expected to find one of the well-known gear keys: "user". Unexpected keys will be ignored.
Everything works well on the server, but initializing the application on the client, although there is no short-term reduction before downloading it, causes this error. Does anyone know how to get around this error, or say redux does not check the form of the initial state? I need βcasesβ for my lazy loaded gearbox.
source share