MyGit

v4.0.0

pmndrs/zustand

版本发布时间: 2022-07-26 09:31:27

pmndrs/zustand最新发布版本:v4.5.4(2024-06-26 20:36:03)

🎉 🎉 🎉 Zustand v4 is here 🎉 🎉 🎉

Backward compatible with v3 in JS

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.

TypeScript types are rewritten

To better support types with middleware, v4 TypeScript code is rewritten. Please find docs/typescript.md for more information.

New API for context usage

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

Deprecated APIs are removed

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.

What's Changed

New Contributors

Full Changelog: https://github.com/pmndrs/zustand/compare/v3.7.2...v4.0.0

相关地址:原始地址 下载(tar) 下载(zip)

查看:2022-07-26发行的版本