Packages

zustand

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

Your version

3.6.0

21 Oct 2021Where it was published

3.7.2 is the newest release of 3.x.

In short

2 new1 fixed

Release note

Summary

This version mainly comes with type improvement for middleware. It's tricky implementation-wise. Please report issues and let's look for solutions or workarounds.
It has renamed and deprecated types: UseStore 👉 UseBoundStore
A new subscribeWithSelector middleware is added, deprecating the equivalent feature in core.

Migrating to subscribeWithSelector middleware

Previously, you could do this:

const useStore = create(...)
useStore.subscribe(callback, selector, equalityFn)

which is deprecated and replaced with:

const useStore = create(subscribeWithSelector(...))
useStore.subscribe(selector, callback, { equalityFn }) // selector is not optional

What's Changed

  • types: Better middleware support

  • types: Rename from UseStore to UseBoundStore

  • middleware: subscribeWithSelector middleware