-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
What is new in v4
v4 API is completely backward compatible, so it's just nothing to update if you are JS users.
One note is v4 depends on use-sync-external-store. There might be some bundling issues. Please report them if you encounter such cases.
To better support types with middleware, v4 TypeScript code is rewritten. Please find docs/typescript.md for more information.
In v3, zustand/context
is provided as a workaround.
v4 API exposes createStore
and useStore
, which are more flexible.
Please read this for usage.
If you are unsure about the usage, open a new discussion.
Counter example: https://codesandbox.io/s/polished-pond-4jn1e2
Some APIs are already deprecated in v3, and they are removed in v4. Please make sure to update to the latest version of v3 before migrating to v4.