state colocation
Keeping state as close as possible to the components that use it, rather than high up in the tree or in global storage.
In more detail
Colocated state is easier to understand and re-renders fewer components when it changes. Lift it only when siblings genuinely need to share it.
Related terms
- lifting state up — Moving state from several child components into their closest common parent so they can share it.
- global state — Data kept where any part of a program can read and change it, such as a module-level variable or an app-wide store.
Taught in
- Lifting State Up: Colocation, Ownership, And Data Flow — React 19 & Modern Component Architecture