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.
Related terms
More in Frontend
State and data