Persist storage : values are converted to strings before replacer #2403
Replies: 4 comments 8 replies
-
Do you have an idea how to fix it? |
Beta Was this translation helpful? Give feedback.
-
Here's the test code: zustand/tests/persistSync.test.tsx Lines 698 to 708 in c092d76 Hmm, I'm not sure how it's not working with |
Beta Was this translation helpful? Give feedback.
-
The same problem with Duration / Timestamp from @bufbuild/protobuf. |
Beta Was this translation helpful? Give feedback.
-
I have the same issue. Its also problematic that in the docs exactly this bug is written as an example |
Beta Was this translation helpful? Give feedback.
-
Summary
I am trying to use
persist
with dates.Bug: values are converted to strings before replacer function so I cannot convert it back to date because I couldn't apply
type: 'date'
to convert it to date inreviver
Link to reproduction
Code sandbox
Check List
Please do not ask questions in issues.
Please include a minimal reproduction.
Please check this if you're filing an issue regarding TypeScript.
create
is to be used ascreate<T>()(...)
and notcreate<T>(...)
.Beta Was this translation helpful? Give feedback.
All reactions