Skip to content

Commit

Permalink
Update jsx-key.md
Browse files Browse the repository at this point in the history
Fix bugs in rendering an array of elements to prevent from unintentional copying it.
  • Loading branch information
Adam Gołąb committed Nov 2, 2017
1 parent aeed629 commit 33c974f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/rules/jsx-key.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ The following patterns are considered warnings:
```jsx
[<Hello />, <Hello />, <Hello />];

data.map(x => <Hello>x</Hello>);
data.map(x => <Hello>{x}</Hello>);
```

The following patterns are **not** considered warnings:

```jsx
[<Hello key="first" />, <Hello key="second" />, <Hello key="third" />];

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

## When not to use
Expand Down

0 comments on commit 33c974f

Please sign in to comment.