Back to Cheatsheets
React

State Management

Managing state at scale

Local State

2 items
CommandDescription
useState
Simple per-component state
useReducer
Complex state transitions

Global State

4 items
CommandDescription
Context API
Low-frequency updates (theme, user)
Zustand / Jotai
Atomic / Flux state management
Redux Toolkit
Large-scale app state
TanStack Query
Server state (cache)

Techniques

3 items
CommandDescription
Lifting State Up
Move state to common ancestor
Prop Drilling
Passing props deeply (avoid)
Colocation
Keep state close to usage