-
SummaryFollowing the persist documentation I've been trying to access The reproduction contains an example ErrorLink to reproduction
Environment
|
Beta Was this translation helpful? Give feedback.
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 |
Beta Was this translation helpful? Give feedback.
-
|
#1795 (reply in thread) |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.


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.