Skip to content

Releases: pmndrs/zustand

v5.0.1

30 Oct 12:05
Compare
Choose a tag to compare

This fixes shallow function for some edge cases.

What's Changed

  • fix(shallow): fallback map-like iterator comparison by @dai-shi in #2795
  • fix(shallow): iterable-like insensitive keys order comparison (alternate implementation) by @dai-shi in #2821

New Contributors

Full Changelog: v5.0.0...v5.0.1

v5.0.0

14 Oct 14:17
Compare
Choose a tag to compare

πŸŽ‰πŸŽ‰πŸŽ‰ Zustand v5 🐻🐻🐻

TL;DR

  • No new features
  • Drop many old things
  • Migration from v4 should be smooth.

Changes in v5

  • Drop default exports
  • Drop deprecated features
  • Make React 18 the minimum required version
  • Make use-sync-external-store a peer dependency (required for createWithEqualityFn and useStoreWithEqualityFn in zustand/traditional)
  • Make TypeScript 4.5 the minimum required version
  • Drop UMD/SystemJS support
  • Organize entry points in the package.json
  • Drop ES5 support
  • Stricter types when setState's replace flag is set
  • Persist middleware behavioral change
  • Other small improvements (technically breaking changes)

Migration Guide

Read the migration guide carefully:
https://github.com/pmndrs/zustand/blob/main/docs/migrations/migrating-to-v5.md

Frequently Reported Issue

During the RC period, some users encountered the following infinite loop error:

Uncaught Error: Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.

This case was already a non-ideal behavior in v4 but appears more explicitly as an error in v5. While there are several ways to resolve this, using useShallow often fixes the problem.

What's Changed

New Contributors

Full Changelog: v4.5.5...v5.0.0

v5.0.0-rc.2

15 Sep 03:17
Compare
Choose a tag to compare
v5.0.0-rc.2 Pre-release
Pre-release

Hopefully, this will be the last RC, unless we have serious bug reports in #2741.

What's Changed

New Contributors

Full Changelog: v5.0.0-rc.1...v5.0.0-rc.2

v5.0.0-rc.1

27 Aug 01:23
Compare
Choose a tag to compare
v5.0.0-rc.1 Pre-release
Pre-release

This version includes some minor changes. Please report any issues if you find.

What's Changed

New Contributors

Full Changelog: v5.0.0-rc.0...v5.0.0-rc.1

v5.0.0-rc.0

16 Aug 01:15
Compare
Choose a tag to compare
v5.0.0-rc.0 Pre-release
Pre-release

Please see the migration guide and share your feedback.

What's Changed

image

New Contributors

Full Changelog: v4.5.5...v5.0.0-rc.0

v4.5.5

15 Aug 02:31
Compare
Choose a tag to compare

This improves the persist middleware behavior for an edge case.

⚠️ We thought this was fixing a bug, but it actually introduced a behavioral breaking change. Please use v4.5.4 if the change is troublesome. See: #2763

What's Changed

New Contributors

Full Changelog: v4.5.4...v4.5.5

v4.5.4

26 Jun 12:36
Compare
Choose a tag to compare

There was an issue in v4.5.3 with some bundlers.

What's Changed

Full Changelog: v4.5.3...v4.5.4

v4.5.3

26 Jun 03:45
Compare
Choose a tag to compare

It comes with a minor fix in types, but also some changes in configs.

What's Changed

New Contributors

Full Changelog: v4.5.2...v4.5.3

v4.5.2

02 Mar 02:45
Compare
Choose a tag to compare

It should improve the compatibility with old browsers.

What's Changed

New Contributors

Full Changelog: v4.5.1...v4.5.2

v4.5.1

17 Feb 02:13
Compare
Choose a tag to compare

People might have misunderstood with useStore deprecation message. Hope this mitigates it.

What's Changed

New Contributors

Full Changelog: v4.5.0...v4.5.1