-
SummaryFollowing the persist documentation I've been trying to access The reproduction contains an example Error
Link to reproduction
Environment
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 12 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.
It looks like this is caused by the fact that if you don't provide the
storage
option when creating the store, thenlocalStorage
is used by default, which isundefined
on 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.persist
is no longerundefined
.Should the whole
persist
object be undefined because of this? Maybe it's something worth mentioning in the docs? In my case I didn't set thestorage
directly as I needed to set it dynamically based on some conditions usingsetOptions
.