-
In the rematch next.js example: https://github.com/vercel/next.js/blob/canary/examples/with-rematch/shared/store.js I'm passing in I have to do this to make it work: const rematchInitialState = init<RootModel>({ models }).getState();
export const initStore = (initialState: any) => {
return init<RootModel>({
models,
plugins: [immerPlugin()],
redux: { initialState: { ...rematchInitialState, ...initialState } }, // Merging initial states
});
}; Is this the correct approach? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
We try to keep the redux section of init method as clean as possible. Some users probably doesn't want this behaviour by default, so it's easier to just do two spreads than creating a config to disable this behaviour. |
Beta Was this translation helpful? Give feedback.
We try to keep the redux section of init method as clean as possible. Some users probably doesn't want this behaviour by default, so it's easier to just do two spreads than creating a config to disable this behaviour.