Packages

zustand

5.0.16 · 22 Oct 2026MIT87.8M / weekRepositorynpmAtom feed

Your version

5.0.0

major14 Oct 2024Where it was published

5.0.16 is the newest release of 5.x.

In short

2 breaking2 removed1 fixed11 changed

  • breaking

    Make React 18 the minimum required version

  • breaking

    Make TypeScript 4.5 the minimum required version

  • removed

    Drop default exports

  • removed

    Drop deprecated features

Release note

Zustand v5

TL;DR

  • No new features

  • Drop many old things

  • Migration from v4 should be smooth.

Changes in v5

  • removed

    Drop default exports

  • removed

    Drop deprecated features

  • breaking

    Make React 18 the minimum required version

  • Make use-sync-external-store a peer dependency (required for createWithEqualityFn and useStoreWithEqualityFn in zustand/traditional)

  • breaking

    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:
github.com/pmndrs/zustand/blob/main/docs/migrat…

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

  • v5

  • Fix Immer type inference for setState