State Management Architecture Decisions in Modern React Applications
Classify state by lifecycle before choosing a library, not the other way around.

Modern React state management is an architecture decision before it is a library decision. Each value represents a kind of state with its own lifecycle. Classify it first, then choose the tool built for its lifecycle. That shift leaves less in client stores and puts server data, local interactions, and navigation where they belong.
Why the old question — which library should we use?, was the wrong question all along
A Redux store holds an API response, an auth token, a form field, and a modal-open flag side by side. The response can go stale. The modal flag cannot. Yet one store treats both as the same kind of storage problem, so the team has to add whatever behavior each value needs.
For much of React’s history, choosing a state library meant choosing where everything would go. That made the library the starting point and ownership an afterthought. The failure was asking one Redux store to handle unrelated lifecycles, then treating the resulting complexity as an unavoidable cost of building an application.
Two platform changes that made the old framing obsolete
React Server Components, now mainstream in Next.js 15, remove a large class of data from the browser’s state-management workload. A component can fetch data and render on the server without shipping that component’s JavaScript to the browser. Data that once went through Redux can now be rendered server-side and streamed as HTML. The task becomes deciding how little state needs to live on the client.
The React Compiler also saves work that developers once did by hand by memoizing components and hooks. Developers mostly no longer need to scatter useMemo, useCallback, and React.memo through components. Meta Quest Store saw improved initial loads and cross-page navigations, with certain interactions becoming more than 2.5× faster after the compiler shipped. But memoization does not repair ownership mistakes. Code involving Date.now(), Math.random(), DOM access, or mutable external state cannot be safely memoized, and decisions about fetching, server boundaries, and Suspense still require engineering judgment.
The four-layer mental model that now precedes every library decision
Local UI state belongs to one component and usually disappears with it. Server state belongs elsewhere, arrives asynchronously, and can become stale. Global client state belongs to the client but is shared across components. URL state describes a view that should survive refreshes or travel in a link.
Those distinctions point to different tools. Local state fits useState or useReducer, while client-side server caching fits TanStack Query. Shared client-owned values fit Zustand or Jotai, and navigation state fits useSearchParams or nuqs. Forms and workflows have needs of their own that call for tools built to handle them. This is a way to avoid rebuilding cache invalidation in Redux, hiding shareable filters in a store, or globalizing a draft that belongs to one form.

Local state: when to stay inside React's built-ins and when to move out
Start with useState when a component owns the value. Modal visibility, dropdown open states, and button-loading flags rarely need more. When several values affect each other or updates get complex, useReducer sends changes through one reducer(state, action) function. That makes the logic explicit and unit-testable without adding store infrastructure. So a multi-step wizard may need a reducer even when it has no need for a global store.
Promotion needs evidence. Passing setters through three or more component levels, or lifting the same state over and over, shows that keeping it local has become awkward. Context offers a useful middle ground for infrequently changing values such as the current user, theme, or localization settings. Those values need reach.
Context’s limit is its subscription behavior. A changed context value re-renders every consumer, even when a consumer reads only one property. Splitting read and write contexts can spare components that only call a setter. The compiler can prevent unnecessary downstream work, but it does not turn Context into property-level subscriptions. For shared data that changes frequently, Zustand is the more appropriate move.
Server state: why TanStack Query has become the unambiguous standard and what it replaced
An API response is not simply an object waiting to be stored. It arrives asynchronously, may fail, and can become stale when a user returns to a tab. Updates also create an invalidation problem because cached data may no longer reflect the server. A plain Redux slice does not resolve those questions. The team has to build and maintain the surrounding machinery for every resource.
TanStack Query is the standard answer because that machinery is its job. It handles fetching, caching, deduplication, retries, background refetching, and stale-while-revalidate behavior. It also has tools for pagination, infinite scroll, optimistic updates, and garbage collection. Replicating that feature set manually takes weeks, with months needed to harden edge cases. The important replacement is therefore not one container with another, but hand-written server-cache management with a tool designed for it.
Server Components narrow where that tool is needed. They can handle initial loads, while TanStack Query handles data requiring client-side caching, invalidation, or real-time updates. The alternatives still have legitimate homes. SWR offers a lighter option when bundle size is the primary constraint, Apollo Client suits GraphQL-first applications needing normalized caching, and RTK Query serves teams already working within Redux Toolkit.
Global client state: the Zustand vs. Jotai decision and what it actually turns on
Once server data leaves the client store, the shared state left in it has a narrower job. Auth session state, theme, cart, and feature flags are the usual examples. Zustand is the dominant greenfield choice for this layer, with no provider requirement, strong TypeScript inference, and a bundle of approximately 1.2 KB minified and gzipped. Its selectors let components subscribe only to the slice they need. That is the key distinction from a single shared Context value.
Zustand’s freedom also creates a structural risk. It imposes no architecture, so a store can become a grab bag of unrelated fields. One store per domain, with actions defined inside the store, supplies the missing conventions. Jotai fits a different shape of problem. It suits independent atoms that depend on one another, substantial derived state, and applications where first-class Suspense integration is important.
Redux Toolkit is still a good choice, especially for large enterprise applications and complex state that needs time-travel debugging or complex state machines. It is not obsolete or inherently slow. Selector-based rendering means the distinction from Zustand is more about boilerplate and developer experience than raw render speed. A narrower role is still a real role, especially when the application already benefits from its structure.
URL state as a first-class state store, not an afterthought
Filters, sort order, search queries, pagination, and active tabs often describe the page a user wants to revisit or share. Keeping them only in a global store cuts them off from navigation. The address bar is a state store too. With useSearchParams or nuqs, the current view can survive a refresh, travel in a link, and work with browser back and forward navigation.
Search text held in a shared context creates a new context value on every keystroke, re-rendering all consumers. Moving that state into the URL removes that particular cascade while making the filtered page shareable. It also leaves the state directly visible in the address bar. An active tab that is purely local can still use useState, but a tab that identifies a shareable view belongs with navigation.
Form state and workflow state: two specialized layers that resist general-purpose solutions
Forms need more than somewhere to keep strings. They need synchronous and async validation, dirty tracking, field-level errors, focus management, and submission handling. Those requirements fit neither Context nor Zustand cleanly. React Hook Form addresses them through uncontrolled inputs, reading values from the DOM rather than maintaining them in React state on every keystroke. That avoids the re-render cascade controlled inputs can create at scale.
Zod adds schema-based, type-safe validation and clean error handling without heavy dependencies. The combination addresses the form’s behavior as well as its values. A draft is still local before submission. Moving it into a global store shares it more widely but still leaves its validation and submission needs unmet, so it belongs in the same place even with a tool built for forms.
Workflows have a different constraint, namely which transitions are allowed. A checkout flow, onboarding wizard, or KYC process may need to block invalid transitions as well as record the current step. XState v5 models those rules with state machines and statecharts and offers improved TypeScript inference over earlier versions. Its niche is narrow but clear. Use it when an invalid transition causes a real user or business problem, and use useReducer for simpler multi-step logic that does not need the full machine model.
The two strongest objections to the layered model and what they actually establish
Signals call into question how well component-level state management performs. Fine-grained reactivity can update the specific DOM node reading a signal without component re-renders or virtual DOM diffing. That is a legitimate engineering advantage. The layered model classifies ownership and lifecycle, but classification alone cannot deliver that update granularity. React has chosen compiler-driven memoization instead, which keeps the same programming model so that useState and useMemo work without a rewrite. For most teams, that makes the compiler the lower-risk performance path.
Many applications have no need for added libraries, which is a stronger reason to leave them out. Server Components can own the data, the router can own navigation, and local state plus one small context can handle the residue. That is sufficient for many content-heavy or data-display applications. It directly challenges adopting Zustand by default.
However, that sufficiency does not extend to every application. Significant client-owned carts, real-time collaborative features, and complex UI surfaces create a different state-management workload. The layered model becomes useful precisely because it distinguishes those applications from ones with little client state. Neither objection justifies a universal library recommendation.
Applying the framework: how to classify state before writing any code
First ask whether it lives on the server, such as a database row or API result. If so, choose between Server Components and client-side server-state handling based on what the data needs. Then ask whether the value belongs to one component and fits useState or useReducer. Before stopping there, check whether it describes a view that should survive refreshes or be shareable, because that requirement points to the URL even when only one component reads it.
Rarely changing theme or locale values fit Context with split read and write providers. Shared state that changes often fits Zustand, while state that is derived and atomic fits Jotai. React Hook Form and Zod are the tools for form inputs before submission. Workflows whose invalid transitions cause real problems call for XState.
This process can produce an application using TanStack Query, Zustand, React Hook Form, and nuqs together. That is specialization, provided each tool has a distinct job. It can also produce an application with no dedicated state library. The simplest tool that fits is the starting point, with state promoted only when concrete evidence demands it. Before asking where a value should be stored, ask who owns it, how it changes, and how long it must live.


