SummaryFollowing the persist documentation I've been trying to access The reproduction contains an example ErrorLink to reproduction
Environment
|
Replies: 3 comments 13 replies
|
It looks like this is caused by the fact that if you don't provide the Here's a repro setting a dummy storage implementation: https://snack.expo.dev/@michal.bar/zustand-persist-undefined-custom-storage. Once a storage option has been set the Should the whole |
|
#1795 (reply in thread) |


It looks like this is caused by the fact that if you don't provide the
storageoption when creating the store, thenlocalStorageis used by default, which isundefinedon React Native.Here's a repro setting a dummy storage implementation: https://snack.expo.dev/@michal.bar/zustand-persist-undefined-custom-storage. Once a storage option has been set the
useBearStore.persistis no longerundefined.Should the whole
persistobject be undefined because of this? Maybe it's something worth mentioning in the docs? In my case I didn't set thestoragedirectly as I needed to set it dynamically based on some conditions usingsetOptions.