pmndrs / zustand

🐻 Bear necessities for state management in React

Home Page:https://zustand-demo.pmnd.rs/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Persist storage : values are converted to strings before replacer

karbone4 opened this issue · comments

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 in reviver

Link to reproduction

Code sandbox

image

Check List

Please do not ask questions in issues.

  • I've already opened a discussion before opening this issue, or already discussed in other media.

Please include a minimal reproduction.

Please check this if you're filing an issue regarding TypeScript.

  • I've read the typescript guide, in particular that create is to be used as create<T>()(...) and not create<T>(...).