Loading…
A short voice session: one question, one follow-up, then instant feedback — up to 5 minutes.
Lift the state up to their closest common parent, pass the value down as props, and pass a callback so the siblings can request changes.
Siblings cannot read each other's state, so the shared value should live in the nearest component that contains both. That parent keeps it in state, passes the value to each sibling as a prop, and passes a function that updates it. This keeps one source of truth, so the two views can never disagree. If the value is needed by many distant components, context or a state library may fit better, but lifting state is the first and simplest option.