Replies: 1 comment
-
By default, the storage implementation has no validation and no type checking. It's not really for production in that sense. (We should clarify that in docs. cc @dbritto-dev ) zustand/src/middleware/persist.ts Line 27 in e74fdc8 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I persist my store, which uses an interface, in localstorage, e.g.
export interface UserAddressTyp { name: string; street: string; }
Now the user manually manipulates their localstorage and edits the key
name
tonam3
. This is accepted by zustand, eventhough it does not adhere to the interface and crashes my app, which expectsname
to exist. For me, it would be sufficient to reset the store and localstorage, if the load encounters inconsistencies as described.Beta Was this translation helpful? Give feedback.
All reactions