zustand
5.0.16 · 22 Oct 2026MIT87.8M / weekRepositorynpmAtom feed
2.2.4 is the newest release of 2.x.
In short
6 changed
Release note
Removed ESM and IIFE versions of middleware.js and shallow.js. Any imports of the ".cjs" files should be changed from "zustand/{name}.cjs" to just "zustand/{name}" as they are all CommonJS now (index.js still has different formats).
api.subscribehas a new function signature that removes the object wrapper:api.subscribe(listener, selector?, equalityFn?).StateListenertype has changed. An overloaded signature was added for better error handling.Subscribetype has changed. It uses the updatedStateListenertype.listenersare iterated in a different order than they were before. Parent to child rather than child to parent. It would be rare if this causes any issues.The automatic fix when passing an array as the second arg of
useStorewas removed.useStorewill throw an Uncaught TypeError if the second arg is an array.