To lift state up in React, move the state to the closest common parent of the components that need it, then pass the value down as props and pass a setter or handler down so children can request changes. This keeps one source of truth, so sibling components can never disagree with each other.
This guide walks through a worked example, shows how data and events flow, and covers the signs that lifting state has gone too far. Examples use React 19 and function components.
You lift state when two or more components must reflect the same changing data. If each keeps its own copy, they drift apart. A typical case is a temperature field in two units, or a search box that filters a separate results list.
Ask this: what is the nearest component that contains every component that reads or writes this value? That component owns the state.
Two inputs show Celsius and Fahrenheit for the same temperature. Neither can own the value, because each needs the other's changes, so the parent holds it.
Only one state variable exists. Fahrenheit is derived from it during render, so it can never be out of sync. The children are now controlled components: they hold no state and only report changes.
value and onChange props.Data flows down through props, and events flow up through callbacks. This is called one-way data flow, and it makes bugs easier to trace because you can find the owner of any value by looking up the tree.
A component is controlled when its important data comes from props and it reports changes through callbacks. It is uncontrolled when it keeps that data in its own state. Lifting state up turns uncontrolled children into controlled ones.
| Aspect | Controlled | Uncontrolled |
|---|---|---|
| Data lives in | Parent | Component itself |
| Flexibility | High, parent can change it | Low |
| Props needed | value and onChange | Often defaultValue |
| Good for | Shared or validated data | Isolated widgets |
A useful pattern is to support both: use the prop when it is given and fall back to internal state otherwise.
The search box and the list are siblings, so the shared query lives in their parent.
The filtered list is derived from query on every render. It does not need its own state.
Lifting state too high forces you to pass props through many layers that do not use them. Before reaching for a global store, try these in order:
children so intermediate components do not need the props.Lift only as far as the nearest common parent. If state is used by one subtree, keep it in that subtree.
At the lowest component that contains everything that reads or writes it. Move it up only when a new component needs it.
No. Lifting moves state to a parent and passes it by props. Context lets descendants read a value without passing props through each level.
Pass a handler like onChange when the parent needs to transform or validate the value. Passing the raw setter is fine for simple cases.
Updating the parent re-renders its children. Usually that is cheap, and you can use React.memo on heavy children if needed.
Lift state up to the nearest common parent when components must share data. Make children controlled with value and onChange, derive anything that can be computed, and keep state as close as possible to where it is used.