Browsing without an account — progress is saved in this browser only.Sign in to save it
Debugging state: who owns it and which component it belongs to
Reading15 min
State belongs to a position in the tree
React keeps state by component type and position, or by key. An index key gives the state of a deleted row to the row that moved up, and a form that copies a prop into state once keeps the old values when the prop changes. Use a stable id as the key, and a key on the form to reset it when the entity changes.
Sign in to try this knowledge check.