Skip to content

[Suggestion]: Improve key attribute explanation #7410

Open
@marcospgp

Description

@marcospgp

Summary

The current docs for the key attribute do not explain in what scenario React actually relies on it

as far as I can tell, this attribute is only relevant for stateful components that rely on their useCallback destructors to be called when the corresponding entry is removed from a list.

Page

https://react.dev/learn/rendering-lists

Details

This comment on reddit may be a good example of a clear explanation of how react actually relies on the key when rendering

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions