📡 You're offline — showing cached content
New version available!
Quick Access
Tutorials React Modern Development Zustand State Management

Zustand State Management

5 min read
Zustand is a simple global state library. const useStore = create(set => ({ count: 0, increment: () => set(s => ({count: s.count+1})) })). No Provider wrapper needed — call the hook directly in any component.

Zustand — Simple Global State

npm install zustand

import { create } from "zustand";

const useStore = create((set) => ({
  count: 0,
  increment: () => set(s => ({ count: s.count + 1 })),
  reset: () => set({ count: 0 }),
}));

function Counter() {
  const { count, increment } = useStore();
  return ;
}