Using a store factory causes state updates #973
Replies: 2 comments 3 replies
-
store factory is generally not recommended, because v4 exposes new APIs to create and use vanilla store. |
Beta Was this translation helpful? Give feedback.
0 replies
-
It does work. However, what if a store is used in both React and Vanilla contexts. Does wrapping it in the createStore do the trick? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Here's the sandbox.
In the second scenario, changing the component causes the local state to be reset.
CleanShot.2022-05-26.at.16.41.49.mp4
I am not sure this is related to react-refresh or to Zustand, but it's quite annoying.
Ideas?
Beta Was this translation helpful? Give feedback.
All reactions