Browse Source

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.
main
Hugh Prior 7 years ago
committed by Alex
parent
commit
788d5094d8
  1. 2
      content/docs/lists-and-keys.md

2
content/docs/lists-and-keys.md

@ -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**

Loading…
Cancel
Save