Zustand is a small, fast state management library for React, and its pitch is simple: a global store with almost no boilerplate. No providers, no reducers, no action types — you create a store with a function, and any component can read from it or update it. If Redux feels like too much ceremony for your app, Zustand is the library most developers try next.
What makes Zustand different is how little it asks of you. A store is plain JavaScript with a set function, and components subscribe to only the slices they use, so re-renders stay minimal. It works with React's hooks model instead of fighting it, and it plays well with TypeScript.
npm install zustand
A counter store shows the whole idea:
// store.js
import { create } from 'zustand'
export const useCounter = create((set) => ({
count: 0,
increment: () => set((state) => ({ count: state.count + 1 })),
reset: () => set({ count: 0 }),
}))
// App.jsx
import { useCounter } from './store'
function Counter() {
const count = useCounter((state) => state.count)
const increment = useCounter((state) => state.increment)
return <button onClick={increment}>Count: {count}</button>
}
Zustand is a great fit for small to medium React apps, side projects, and any app where Redux would be overkill. It also handles async actions cleanly, and its middleware system adds persistence and devtools only when you ask for them.
The limits are honest ones. Zustand has no built-in conventions for very large apps, so big teams may miss Redux's structure. Its ecosystem of add-ons is smaller, and server state is still better handled by a data-fetching library. But for client state, that trade is usually worth it.
If your next React project needs shared state, try Zustand for one store first: create it, read it in two components, and update it from a third. You will know within an hour whether its simplicity fits the way you build.
Top comments (0)