Breaking change on persist middleware
See original GitHub issueSince this PR https://github.com/pmndrs/zustand/pull/894 (and release 3.7.2
), the persist
middleware now makes our selectors return undefined
.
I first thought it was caused because of rehydration issues, but the onRehydrateStorage
fires before the exceptions related to finding undefined
instead of the expected value.
Our store is composed of slices like this:
const createRootSlice = (
set: SetState<any>,
get: GetState<any>,
api: StoreApiWithPersist<any>
) => {
return {
...persist(createAgentsStoreSlice, {
name: "agents",
partialize: (state) => {
return {
agentsEntriesByAssetTokenAddress:
state.agentsEntriesByAssetTokenAddress,
};
},
})(set, get, api),
...[OTHER SIMILAR SLICES],
}
}
Issue Analytics
- State:
- Created a year ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
Persist middleware - Zustand Documentation
If you want to introduce a breaking change in your storage (e.g. renaming a field), you can specify a new version number. By...
Read more >Change Log - Redux-Bundler documentation
Breaking change to createCacheBundle . It now takes an options object as an argument instead of just a cache function. This allows us...
Read more >NEXT.JS with persist redux showing unexpected behaviour
My working store in Next.js app. Try to fix your store. store.js import { createWrapper } from 'next-redux-wrapper'; ...
Read more >Migrating from V1 | The React Native Boilerplate - GitHub Pages
This is not really a migration guide because there is so much breaking changes between the two versions and mostly because of the...
Read more >Redux: Persisting the State to the Local Storage - Egghead.io
We will learn how to use store.subscribe() to efficiently persist some of the ... Redux: Fetching Data on Route Change ... Redux: Applying...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Closing this. Please open a new issue with a reproduction.
Thanks for reporting! (It’s unfortunate that we have no plan to release v3 anymore. So, please use v3.7.1 meanwhile. tbh, it was good that we released v3.7.2 before v4 to get this issue.)