You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want my store to be persistent so I save every change to local storage and load it back when the website gets refreshed.
However, every time my website gets refreshed and the reducers get injected again, it clears half of my state.
If I inject the notificationSlice reducer first -> it clears the accountSlice. And vice versa.
When I tried debugging it I found that just after the refresh the state loads just fine (from the local storage) but it breaks when the reducers are injected.
How to fix this?
The text was updated successfully, but these errors were encountered:
I have two slices in my store. Each has one reducer which I inject at the root of my react app.
notificationSlice.ts
accountSlice.ts
I want my store to be persistent so I save every change to local storage and load it back when the website gets refreshed.
However, every time my website gets refreshed and the reducers get injected again, it clears half of my state.
If I inject the notificationSlice reducer first -> it clears the accountSlice. And vice versa.
When I tried debugging it I found that just after the refresh the state loads just fine (from the local storage) but it breaks when the reducers are injected.
How to fix this?
The text was updated successfully, but these errors were encountered: