close
breadcrumb right arrowGlossary
breadcrumb right arrowState Management

State management is the practice of storing, updating, and sharing the data ("state") that determines what an application renders and how it behaves at any given moment — things like form inputs, whether a modal is open, the current user's session, or data fetched from a server.

Why it matters

As an application grows, state tends to be needed in multiple places at once: a shopping cart total shown in a header, a filter selection that changes a list below it, or an authentication flag that gates entire routes. Without a deliberate strategy, this data ends up duplicated, out of sync, or passed through long chains of components ("prop drilling"), making bugs harder to trace and features harder to add.

Common categories

  • Local (component) state — data relevant to a single component, such as whether a dropdown is expanded.
  • Global (application) state — data shared across many parts of the app, such as the logged-in user or theme preference.
  • Server (remote) state — data that originates from an API and needs caching, refetching, and synchronization, such as a list of orders.
  • URL state — data encoded in the address bar itself, such as a search query or pagination page.

Common tools and patterns

In frontend development, teams reach for patterns and libraries such as React's built-in useState/useContext, Redux, Zustand, Jotai, MobX, or query-caching libraries like TanStack Query (for server state specifically). On the backend, state management often refers to how session data, workflow progress, or distributed system state is persisted and kept consistent — for example in a database, a cache like Redis, or a durable execution engine.

Key takeaway

Good state management keeps an application's data predictable and easy to reason about: it's clear where a piece of data lives, what can change it, and how those changes propagate to everything that depends on it.