mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-27 03:08:06 +00:00
Update lists-and-keys.md (#559)
I think the word "root" is misleading here. For me the root implies a single item, and the <li> here is more of a leaf. I think we can avoid all confusion simply by removing the word.
This commit is contained in:
@@ -138,7 +138,7 @@ Here is an [in-depth explanation about why keys are necessary](/docs/reconciliat
|
||||
|
||||
Keys only make sense in the context of the surrounding array.
|
||||
|
||||
For example, if you [extract](/docs/components-and-props.html#extracting-components) a `ListItem` component, you should keep the key on the `<ListItem />` elements in the array rather than on the root `<li>` element in the `ListItem` itself.
|
||||
For example, if you [extract](/docs/components-and-props.html#extracting-components) a `ListItem` component, you should keep the key on the `<ListItem />` elements in the array rather than on the `<li>` element in the `ListItem` itself.
|
||||
|
||||
**Example: Incorrect Key Usage**
|
||||
|
||||
|
||||
Reference in New Issue
Block a user