We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import AsyncStorage from '@react-native-async-storage/async-storage'; import {configureStore} from '@reduxjs/toolkit'; import { persistStore, persistReducer, FLUSH, REHYDRATE, PAUSE, PERSIST, PURGE, REGISTER, } from 'redux-persist'; import {rootReducer} from './reducers'; const persistConfig = { key: 'Root', version: 1, storage: AsyncStorage, }; const persistedReducer = persistReducer(persistConfig, rootReducer); export const store = configureStore({ reducer: persistedReducer, middleware: getDefaultMiddleware => getDefaultMiddleware({ serializableCheck: { ignoredActions: [FLUSH, REHYDRATE, PAUSE, PERSIST, PURGE, REGISTER], }, }), }); export const persistor = persistStore(store);
import {combineReducers} from '@reduxjs/toolkit'; import postReducer from './post_reducer'; import profilereducer from './profile_reducer'; import utilReducer from './utils_reducer'; export const rootReducer = combineReducers({ utilities: utilReducer, profile: profilereducer, post: postReducer, });
<Provider store={store}> <PersistGate loading={null} persistor={persistor}> <AppNavigator /> <PersistGate> </Provider>
My redux actions are working correctly and the store updates each dispatch. But the state is not persisting on refreshing or reopening the app.
What to do in this case?
The text was updated successfully, but these errors were encountered:
@uttu-316, persistence is working for me following the official documentation on RTK + redux-persist. Check it out here: https://redux-toolkit.js.org/usage/usage-guide#use-with-redux-persist
Sorry, something went wrong.
No branches or pull requests
My redux actions are working correctly and the store updates each dispatch. But the state is not persisting on refreshing or reopening the app.
What to do in this case?
The text was updated successfully, but these errors were encountered: