2026-03-12
React state: when local state is enough
A short note on lifting state, server cache, and global stores.
Local useState is still the default. If only one subtree cares, keep it there.
Server cache (for example React Query) shines when the same remote data is read in multiple routes or refetched on a schedule. Pair it with clear query keys and stale-time defaults so the UI stays predictable.
Redux (with thunks or sagas) is still a strong choice when you need a single auditable place for cross-cutting workflows, middleware, or time-travel debugging in complex apps.
The trap is choosing the global solution first. Start small, measure pain, then adopt the tool that removes it.