Skip to content

Commit c42b624

Browse files
ioggstreamljharb
authored andcommitted
[Docs] jsx-key: split the examples
I didn't understand these were three different examples.
1 parent 527db86 commit c42b624

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
1010

1111
### Changed
1212
* [Docs] [`jsx-tag-spacing`]: rename option from [#3264][] ([#3294[] @ljharb)
13+
* [Docs] [`jsx-key`]: split the examples ([#3293][] @ioggstream)
1314

1415
[#3294]: https://github.com/jsx-eslint/eslint-plugin-react/issues/3294
16+
[#3293]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3293
1517
[#3291]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3291
1618

1719
## [7.30.0] - 2022.05.18

docs/rules/jsx-key.md

+10
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,13 @@ Examples of **incorrect** code for this rule:
99

1010
```jsx
1111
[<Hello />, <Hello />, <Hello />];
12+
```
1213

14+
```jsx
1315
data.map(x => <Hello>{x}</Hello>);
16+
```
1417

18+
```jsx
1519
<Hello {...{ key: id, id, caption }} />
1620
```
1721

@@ -21,9 +25,13 @@ Examples of **correct** code for this rule:
2125

2226
```jsx
2327
[<Hello key="first" />, <Hello key="second" />, <Hello key="third" />];
28+
```
2429

30+
```jsx
2531
data.map((x) => <Hello key={x.id}>{x}</Hello>);
32+
```
2633

34+
```jsx
2735
<Hello key={id} {...{ id, caption }} />
2836
```
2937

@@ -43,7 +51,9 @@ Examples of **incorrect** code for this rule:
4351

4452
```jsx
4553
[<></>, <></>, <></>];
54+
```
4655

56+
```jsx
4757
data.map(x => <>{x}</>);
4858
```
4959

0 commit comments

Comments
 (0)