← All writing
Frontend·Aug 16, 2026·6 min read

State management is a people problem, not a library problem

Redux, Zustand, Context — the library rarely explains why state got messy. Team habits do.

H

Hammad Iqbal

Software Engineer

Every codebase I've inherited with 'state management problems' had a perfectly reasonable library at the center of it. The mess was never the tool. It was an unwritten rule about where state is allowed to live that nobody agreed on.

In brief
  • Global stores get messy when local state gets pushed into them out of convenience.
  • The real question isn't which library — it's who owns which slice of state.
  • A short, written convention prevents more bugs than a library migration does.

Global state is a symptom, not a root cause

A form's draft value doesn't need to live in a global store. Neither does whether a dropdown is open. When these end up there anyway, it's usually because reaching for the existing store was easier than deciding where local state should actually live — not because the data needed to be shared.

Ownership beats architecture diagrams

A state management diagram looks tidy in a design doc and falls apart the first time two features need overlapping data. What holds up in practice is a simple rule everyone actually follows: server data lives in the data-fetching layer, UI state lives in the component, and only cross-cutting concerns — auth, theme, an open modal — go in a shared store.

  • Server data: owned by the fetching layer (React Query, RTK Query, or equivalent)
  • Component-local UI state: stays in the component
  • Cross-cutting concerns: the only thing allowed in the global store

Migrating libraries doesn't fix a missing convention

I've seen a Redux-to-Zustand migration recreate the exact same tangle within two sprints, because the underlying habit — reach for global state when unsure — never changed. The fix was a half-page convention doc and a couple of PR comments enforcing it, not a rewrite.

Takeaway

Before switching libraries to fix messy state, write down who owns what. Most of the mess turns out to live in the missing rule, not the tool.

Have a project this kind of thinking applies to?

Tell me what you're building — I read every message myself.

Available for new projects

4+

Years exp.

8+

Projects shipped

<6h

Avg. reply time

Let's build something

Tell me about your project.

Share what you're building, your timeline, and the best way to reach you.