[ad_1]
New to SSR/node.js and redux toolkit.
I am trying to figure out how to set the initial state of the store on the client side with the store coming from server side.
The store is a user session (name, email, etc.) that is being injected via window object. I can verify that it is being passed to the client because previously it has been using just redux. Looking to take full advantage and wanted to convert to redux-toolkit.
Wondering if preloadedState
is the way to go here?
const initialState = window.redux_store;
export const store = configureStore({
reducer: {},
preloadedSate: initialState
});
Or am I missing something?
TIA!
[ad_2]