
Every React application ends up with some state that does not belong to a single component: a signed-in user, an open side panel, a multi-step form, the filters on a dashboard. React's own tools can share it, but passing props through many layers gets tedious, and a large Context can make big parts of the tree re-render on every change. Redux solved this for years at the price of extra structure. Zustand takes the opposite approach: a store is a hook, there is no provider to set up, and each component subscribes only to the part of the state it uses.
This article explains what Zustand is, how it works, where it fits, when another tool is the better choice, and how it compares with Redux, Jotai and React Context.
What is Zustand?
Zustand is an open-source state management library for React. Its README describes it as "a small, fast and scalable bearbones state-management solution using simplified flux principles". You create a store with one function, use it in any component as a hook, and read only the values you need through selectors. The same stores also work in React Native and, through a "vanilla" API, outside React altogether.
The name is the German word for "state". The library is developed by pmndrs (Poimandres), an open-source developer collective, and released under the MIT licence; its licence file names Paul Henschel as the original copyright holder. The first package was published on npm in April 2019 and version 1.0 followed on 28 June 2019. Zustand 4 arrived in July 2022, and Zustand 5, released on 14 October 2024, made React 18 the minimum version, dropped default exports and removed deprecated features.
How Zustand works
A store is a hook. You call create with a function that returns the initial state and the actions that change it. The result is a hook such as useCartStore. Any component can call it; nothing has to wrap the application, because the store lives outside the React tree rather than in a context.
Selectors decide what re-renders. A component passes a selector, for example useCartStore((s) => s.items.length), and Zustand re-renders that component only when the selected value changes. That is the main difference from a naive React Context, where every consumer re-renders whenever any part of the context value changes. For selectors that return several values, the useShallow helper compares them shallowly.
Updates are immutable and explicit. State follows an immutable model, as in Redux. Actions call set with the fields to change, and Zustand shallowly merges them into the current state; nested objects are copied by hand or with Immer. There are no action types, reducers or dispatch calls to write unless you want them.
Middleware adds the rest. Optional middleware covers persistence to local storage, integration with the Redux DevTools, Immer for writing updates in a mutable style, Redux-style reducers and subscriptions to selected slices of state.
Server rendering needs care. On a server that handles many requests at once, a module-level store would be shared between users. The official Next.js guide therefore says to create the store per request, not as a global variable, to share it through a context provider built with createStore, and not to read or write it from React Server Components, which cannot use hooks or context.
Key features
- Minimal API: one function to create a store, one hook to use it.
- No providers for client-side apps, and no action types or reducers.
- Selector-based subscriptions that keep re-renders limited to the components that need them.
- Middleware for persistence, devtools, Immer and Redux-style reducers.
- Works outside React through the vanilla store, and in React Native.
- TypeScript support with typed stores and selectors; Zustand 5 requires TypeScript 4.5 or later.
- Handles React edge cases that the README calls out: the "zombie child" problem, React concurrency and context loss between mixed renderers.
Where Zustand is used
- Next.js and React applications that keep server data on the server and need a small client-side store for interface state.
- Dashboards and admin panels with filters, selections and panels that many components read.
- Multi-step forms and wizards, where several screens build up one object.
- React Native apps that want the same state code as their web counterpart.
- Interactive and graphics-heavy interfaces, where re-rendering only the components that changed keeps the UI smooth.
When to choose Zustand, and when not to
Choose Zustand when:
- You need shared client state without the setup and boilerplate of Redux.
- Re-render performance matters and Context has started to slow parts of the tree.
- You want small, feature-sized stores rather than one global store designed up front.
- The team wants a tool that new developers understand in an afternoon.
Look elsewhere when:
- Most of your "state" is really server data: lists, records and API responses. A data-fetching library with caching, such as TanStack Query, or Server Components in Next.js, handle that better. Zustand is for client state.
- A large team needs strict conventions, middleware for every action and a single, well-documented architecture. Redux Toolkit, the official way to write Redux today, gives more structure.
- Your state is a graph of many small, interdependent values. An atom-based library such as Jotai models that more naturally.
- The state is local to one component or a small subtree.
useStateor a small Context is enough, and adding a library is unnecessary.
Zustand and its alternatives
| Option | Model | Strength | Best fit |
|---|---|---|---|
| Zustand | Store as a hook, immutable, selectors | Very little code, no provider | Lean client state in React and Next.js |
| Redux Toolkit | Single store, slices, actions and reducers | Strict structure, mature tooling | Large teams that want one shared architecture |
| Jotai | Composable atoms | Fine-grained dependencies | Many small, interdependent values |
| MobX | Observable, mutable state | Reactive, object-oriented style | Teams used to observable models |
React Context + useState | Built into React | No extra dependency | Small amounts of rarely changing shared state |
The comparison people search for most is Zustand vs Redux. The Zustand documentation itself sums it up: both use immutable state and both recommend selectors for render optimisation, but Redux requires the app to be wrapped in a context provider and Zustand does not. In practice Zustand needs much less code for the same feature, while Redux Toolkit offers a more prescribed architecture and a larger set of conventions. MobX takes a different path again, with mutable observable state. Against plain React Context, Zustand's advantage is that components subscribe to slices of state instead of the whole value.
How we use Zustand at Internative
Zustand is our default for client-side state in the Next.js applications we build. It fits cleanly with React Server Components: server state stays on the server, and client state lives in Zustand. Stores survive hot module replacement without losing their state during development, and selector-based subscriptions avoid the whole-tree re-renders that naive Context usage causes. The result is small stores, a small bundle and a productive team.
If you are planning a React or Next.js application, our web application development team can help you design a state layer that stays simple as the product grows.
Frequently asked questions
What does "Zustand" mean?
"Zustand" is the German word for "state", which describes what the library manages. In software it refers to the open-source state management library for React, developed by the Poimandres (pmndrs) developer collective and released under the MIT licence.
Is Zustand better than Redux?
For most small and medium React applications, Zustand is simpler: a store is a hook, no provider is needed and there are no action types or reducers. Redux, written today with Redux Toolkit, is better suited to large teams that want a strict, shared architecture and its mature tooling. Both handle performance well when you use selectors.
Does Zustand work with Next.js?
Yes, with one rule for server rendering. Because a Next.js server handles many requests at once, the official guide says to create the store per request instead of as a global variable and share it through a context provider. React Server Components should not read or write the store; they cannot use hooks or context.
Can Zustand be used outside React?
Yes. Zustand's vanilla API creates stores without React, so the same state logic can be used in plain JavaScript, tests or other libraries. The same stores also run in React Native.
Keep reading
The articles that follow this one.



