Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docs] jsx-key: improve example #3202

Merged
merged 1 commit into from Feb 11, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -32,7 +32,9 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
* [Docs] [`forbid-foreign-prop-types`]: document `allowInPropTypes` option ([#1815][] @ljharb)
* [Refactor] [`jsx-sort-default-props`]: remove unnecessary code ([#1817][] @ljharb)
* [Docs] [`jsx-no-target-blank`]: fix syntax highlighting ([#3199][] @shamrin)
* [Docs] [`jsx-key`]: improve example ([#3202][] @chnakamura)

[#3202]: https://github.com/yannickcr/eslint-plugin-react/pull/3202
[#3199]: https://github.com/yannickcr/eslint-plugin-react/pull/3199
[#3198]: https://github.com/yannickcr/eslint-plugin-react/pull/3198
[#3195]: https://github.com/yannickcr/eslint-plugin-react/pull/3195
Expand Down
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