Skip to content

Commit

Permalink
Update jsx-key.md
Browse files Browse the repository at this point in the history
Using an index for a key is a violation of the [no-array-index-key](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-array-index-key.md) lint rule
  • Loading branch information
chnakamura committed Feb 11, 2022
1 parent 7dfcbfb commit 104523b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/rules/jsx-key.md
Expand Up @@ -22,7 +22,7 @@ Examples of **correct** code for this rule:
```jsx
[<Hello key="first" />, <Hello key="second" />, <Hello key="third" />];

data.map((x, i) => <Hello key={i}>{x}</Hello>);
data.map(x => <Hello key={x.id}>{x}</Hello>);

<Hello key={id} {...{ id, caption }} />
```
Expand Down

0 comments on commit 104523b

Please sign in to comment.