Frontend · Concept

State management

How an app keeps track of changing information, such as who is signed in, what is in the basket or which tab is open, and keeps every part of the screen in step with it.

State and data · updated

How it works

State is any data that can change while the app runs. Some belongs to one component (whether a menu is open), some is shared across screens (the signed-in user, a basket), some really lives on a server and is only cached in the browser (a list of orders), and some belongs in the URL (search filters). Mixing these up is a common source of bugs.

Frameworks provide local state (useState in React, ref in Vue, signals in Angular and Svelte runes). For shared state, React apps use context or a store library such as Zustand or Redux; Vue has Pinia; Angular has services and NgRx. For server data, a caching library such as TanStack Query usually replaces most hand-written global state.

More in Frontend

State and data

All 26 Frontend terms

Crafted in the dark. Shipped to the world.

Tell us what you are building. You get a private project space with a proposal and a line-by-line quote within a day.