rt2zz / redux-persist

persist and rehydrate a redux store
MIT License
12.94k stars 866 forks source link

Why state change but don't change in localstorage ? #633

Open ghost opened 6 years ago

ghost commented 6 years ago

This is my code: const config = { key: 'users_redux_state', storage, } const reducer = persistCombineReducers(config,{ user:logged_user_reducer, } ) export let store = createStore(reducer) let persistor = persistStore(store)

And I wrapped my routes by <PersistGate persistor={persistor}> The problem is the local storage don't change even if state redux change , but when I refresh the page it changes .

ChrisLahaye commented 6 years ago

I encounter the same problem, even after awaiting a flush.

Keethanjan commented 6 years ago

This is also happening for me. When I use an empty string ('') instead of undefined it is automatically updated though.