From harness-claude
Guides selecting React state management patterns: useState/useReducer, Context, Zustand, Redux Toolkit, React Query/SWR by app scale, shared state needs, and performance.
npx claudepluginhub intense-visions/harness-engineering --plugin harness-claudeThis skill uses the workspace's default tool permissions.
> Choose the right state management approach for your React application scale
Implements React state management patterns with Redux Toolkit, Zustand, Jotai, React Query for global state, server state, optimistic updates, and library selection.
Guides React state management patterns with Redux Toolkit, Zustand, Jotai, React Query for local, global, server state, and library selection.
Guides selection and correct implementation of frontend state management patterns using Redux, Zustand, MobX, Jotai, Recoil, and React Context. Addresses global state, prop drilling, and store architecture.
Share bugs, ideas, or general feedback.
Choose the right state management approach for your React application scale
Decision tree:
useState / useReducer. Do not reach for global state until you have a specific problem.useContext for data that rarely changes (theme, auth, locale).// Zustand: minimal setup
import { create } from 'zustand';
interface BearStore {
count: number;
increment: () => void;
}
const useBearStore = create<BearStore>((set) => ({
count: 0,
increment: () => set((s) => ({ count: s.count + 1 })),
}));
State categories:
Library comparison (2024):
| Library | Bundle | Boilerplate | DevTools | Selectors |
|---|---|---|---|---|
| Context | 0KB | Low | No | No |
| Zustand | ~1KB | Very low | Yes | Yes |
| Jotai | ~3KB | Low | Yes | Atoms |
| Redux Toolkit | ~12KB | Medium | Excellent | Yes |
React 19 note: With the React compiler, many manual performance optimizations in Zustand/Redux become less necessary as React auto-memoizes.
https://patterns.dev/react/state-management