component identity

How React decides that a component in the new render is the same one as before, so it keeps its state.

In more detail

Identity comes from the component position in the tree, its type and its key. Same position, type and key means state is kept; a different type or key means the old component is unmounted and a new one mounted with fresh state.

Related terms

Taught in

References