Open priosshrsth opened 3 years ago
Yeah, I found this issue too.
After review, I realized that I am using redux-injectors
to combine the reducers dynamically. Thus I have to set the option: manualPersist: true
and manually dispatch the persist event later.
@mutoo do you call persistor.persist
or do you use store.dispatch to call the persist method? Please share your solution for this
@mutoo do you call
persistor.persist
or do you use store.dispatch to call the persist method? Please share your solution for this
hi @smac89 here is the code related to my issue
the persistor with manualPersist
disabled:
https://github.com/mutoo/critterpedia-plus/blob/d0be98768a6bc87ff01e006cceaa57092c9730ab/app/configureStore.js#L65
export const persistor = persistStore(store, { manualPersist: false });
the component that injects persistReducer and manually dispatches persist with persistor: https://github.com/mutoo/critterpedia-plus/blob/d0be98768a6bc87ff01e006cceaa57092c9730ab/app/pages/Critterpedia/index.js#L46
useInjectReducer({ key, reducer });
useEffect(() => {
persistor.persist();
}, []);
I hope this will help you.
Hi there! Same issue here. Any solutions? Not using redux-injectors
In my app, redux persist was not working in production. But, everything was working fine on development environment. Turns out it only works when redux dev tool is enabled, which was disabled in production mode. Is it supposed to be like this? I am using these packages in my next.js app:
Here is my code: