redux-persist v7 beta wraps the root reducer and reloads the previous user's state if a logout reset sits in the wrong place
persist and rehydrate a redux store
At a glance
- What is it?
- The endograph fork of redux-persist saves a Redux store to storage and restores it at startup. This piece covers the persistReducer and persistStore pair, allowlist and denylist, the logout reset trap, and why the newest release tag is from 2019.
- Who is it for?
- Use redux-persist when you want a Redux or Redux Toolkit store to survive restarts with a few lines around the root reducer. Do not adopt the v7 beta for production without testing, since the install line is redux-persist@next and the newest release tag is v6.0.0 from 2019-09-02.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 23 days ago.
- What is it written in?
- Mainly TypeScript, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 26, 2026, and from our analysis. They are not legal advice.
Star history
- endograph/redux-persist12,952 ★ · +3
| Repository | 2026-10-11 | 2026-11-26 |
|---|---|---|
| endograph/redux-persist | 12.9k | 13k |
3 Stars in the last 46 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
Two calls do the work: persistReducer wraps the root, persistStore makes the persistor
redux-persist saves state to storage as it changes and restores it into the store when the app starts. The integration is two calls. persistReducer takes a config and your root reducer and returns a reducer that writes through to storage. persistStore creates the persistor that drives rehydration.
The quickstart config has three fields: key set to 'root', version set to 1, and storage imported from redux-persist/storage, which is localStorage on the web. The example combines a user reducer and a config reducer with combineReducers from @reduxjs/toolkit, then passes the result to persistReducer.
Install is a single command:
npm install redux-persistThe language is TypeScript and the license is MIT. The README states that nothing else in your app changes and that Redux Toolkit needs no extra setup.
The v7 beta requires Redux 5 or Redux Toolkit 2
A note at the top of the README says redux-persist is maintained again and v7 is in beta, installed with npm install redux-persist@next. The note lists Redux Toolkit 2 support with no extra setup and a fix for stored data getting wiped, tracked as issue 809.
The docs in the repository are for v7, which needs Redux 5 or Redux Toolkit 2. A project pinned to an older Redux has to use the v6 docs, which live under the v6 tag. package.json shows the version as 7.0.0-beta.2, which matches the beta wording.
Upgrading from 6 has a migration guide at docs/MigrationGuide-v7.md. The README says stored data carries over as is. There is also a v4 to v5 guide, docs/MigrationGuide-v5.md, for older apps. Feedback on the beta goes to a GitHub discussion numbered 1527.
The newest release tag is v6.0.0 from 2019 while pushes continue to 2026
The repository is not archived, and its last push was on 2026-10-07. The three listed releases are v6.0.0 on 2019-09-02, v6.0.0-pre2.0 on 2019-07-05 and the v6.0.0 Preview on 2019-05-07. No v7 tag appears in that list.
That gap tells you where v7 lives. The beta ships on the next tag in npm and in package.json, not as a GitHub release. Anyone reading only the releases page will conclude the project stopped in 2019, which the README contradicts when it says the library is maintained again.
The top-level files include AGENTS.md and CLAUDE.md next to CONTRIBUTING.md, CHANGELOG.md and eslint.config.mjs. The repository also has tests/ and integration/ directories. If you track upstream changes, CHANGELOG.md is the place to read what moved in v7.
A logout reset above persistReducer deletes the _persist key
The README's most pointed warning concerns resetting state on logout. The safe pattern puts the reset inside the reducer you pass to persistReducer:
const rootReducer = (state, action) =>
appReducer(action.type === 'user/logout' ? undefined : state, action)
const persistedReducer = persistReducer(persistConfig, rootReducer)The reset state is then saved like any other change. To write it at once, for example before the app might close, call await persistor.flush() after dispatching the action.
The unsafe pattern is resetting above persistReducer, either by wrapping the persisted reducer or with a store enhancer that replaces the whole state. That removes the _persist key, so the state stops being saved, and the previous user's state is loaded again on the next launch. On a shared device, that is another person's data. redux-persist logs an error in development when this happens, which means production builds give no such signal.
Allowlist and denylist filter top-level keys only, and a function covers keys you cannot list
denylist and allowlist select top-level keys of the state. The README examples are denylist: ['navigation'] to skip that key and allowlist: ['navigation'] to persist only that key. They are checked against your state's keys, so a typo is a type error. If the config is declared separately, annotate it with PersistConfig<RootState> or use as const on the array.
The older names blacklist and whitelist still work, so older tutorials stay valid. For keys you cannot list ahead of time, denylist accepts a function called with each top-level key, such as key => key.startsWith('temp').
The limit is depth. Filtering stops at the first level of your state. Going deeper means nested persists, documented in docs/nested-persists.md, where each branch gets its own persisted reducer. Transforms, documented in docs/transforms.md, are the other lever for changing what gets serialized on the way in and out.
The default merge goes one level deep and the README tells you to decide before shipping
When stored state comes back, it has to be merged into the initial state. The README says every app has to decide how many levels to merge, and that the default is one level. It tells you to read the state reconcilers page, docs/state-reconciler.md, before you ship.
The cost of ignoring this shows up when state shape changes between versions. A shallow merge replaces whole top-level slices, so a new field added inside a persisted slice can be missing after rehydration. Versioning is the companion feature: the version field in the config plus migrations, covered in docs/migrations.md, upgrades stored state when its shape changes.
The repository also documents a storage format and a compatibility promise in docs/storage-format.md. If you write your own storage engine, or read stored values from outside the library, that page is the contract to check.
PersistGate and useRehydrated give two ways to wait for stored state
For React, PersistGate from redux-persist/react holds off rendering until stored state has loaded back into Redux. Its loading prop can be null or any React element, such as loading={<Loading />}. It sits inside the Provider and takes the persistor as a prop.
If you would rather not gate rendering, useRehydrated(persistor) from redux-persist/react returns whether stored state has loaded. The component keeps rendering and you decide what to show meanwhile.
Server rendering has its own rule. redux-persist/storage works during server rendering with Next.js and others: on the server it stores nothing, and stored state is loaded in the browser. With the Next.js App Router, PersistGate must be rendered from a Client Component. package.json carries a react-server export condition for ./react, which is how the server build is picked.
On React Native, pass the storage engine explicitly, with AsyncStorage from @react-native-async-storage/async-storage as the example. Other engines are listed in docs/storage-engines.md.
Editorial conclusion
Use redux-persist when you want a Redux or Redux Toolkit store to survive restarts with a few lines around the root reducer. Do not adopt the v7 beta for production without testing, since the install line is redux-persist@next and the newest release tag is v6.0.0 from 2019-09-02. Before shipping, read the state reconciler page and place your logout reset inside persistReducer.
Frequently asked questions
What is redux-persist?
redux-persist saves a Redux store to storage as it changes and restores it when the app starts. You wrap the root reducer with persistReducer and call persistStore.
How do I install redux-persist?
Run npm install redux-persist for the quickstart. The v7 beta is installed with npm install redux-persist@next and needs Redux 5 or Redux Toolkit 2.
What is whitelist in redux-persist?
whitelist is the older name for allowlist, which lists the top-level state keys to persist. The older names blacklist and whitelist still work alongside denylist and allowlist.
Is redux-persist deprecated?
The README says redux-persist is maintained again and that v7 is in beta. The repository is not archived and was last pushed on 2026-10-07.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/endograph-redux-persist)Star history chart for your README
[](https://hysenlabs.com/projects/endograph-redux-persist)Was this useful?