Skip to content

Honor instance identity (the "key" prop) for the root component #590

@ide

Description

@ide

When the "key" prop of a component changes between render passes, React is expected to unmount the previous instance and mount a new one during reconciliation. However, when said component is the root (i.e. whose DOM parent is the mount point) the same component instance is used.

This JSFiddle demonstrates how a stateful component with a changing "key" is not unmounted when it is the root: http://jsfiddle.net/Yd25R/1/

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions