Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange

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

[#3294]: https://github.com/jsx-eslint/eslint-plugin-react/issues/3294
[#3293]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3293
[#3291]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3291

## [7.30.0] - 2022.05.18
Expand Down
10 changes: 10 additions & 0 deletions docs/rules/jsx-key.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ Examples of **incorrect** code for this rule:

```jsx
[<Hello />, <Hello />, <Hello />];
```

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

```jsx
<Hello {...{ key: id, id, caption }} />
```

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

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

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

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

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

```jsx
[<></>, <></>, <></>];
```

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

Expand Down