Skip to content

Commit

Permalink
[Docs] jsx-sort-propts: replace ref string with ref variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Luccasoli authored and ljharb committed Aug 30, 2022
1 parent 9055439 commit 3d58253
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
12 changes: 9 additions & 3 deletions CHANGELOG.md
Expand Up @@ -6,16 +6,22 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
## Unreleased

### Fixed
* [`jsx-key`]: avoid a crash with optional chaining ([#3371][], @ljharb)
* [`jsx-key`]: avoid a crash with optional chaining ([#3371][] @ljharb)


### Changed
* [Docs] [`jsx-sort-propts`]: replace ref string with ref variable ([#3375][] @Luccasoli)

[#3375]: https://github.com/jsx-eslint/eslint-plugin-react/issues/3375
[#3371]: https://github.com/jsx-eslint/eslint-plugin-react/issues/3371

## [7.31.1] - 2022.08.26

### Fixed
* [`jsx-key`]: fix detecting missing key in `Array.from`'s mapping function ([#3369][] @sjarva)
* [`jsx-no-leaked-render`]: coerce strategy now allows a ternary ([#3370][], @sjarva)
* [`jsx-no-leaked-render`]: coerce strategy now allows a ternary ([#3370][] @sjarva)

[7.31.1]: https://github.com/jsx-eslint/eslint-plugin-react/compare/v7.31.0...v7.31.1
[#3371]: https://github.com/jsx-eslint/eslint-plugin-react/issues/3371
[#3370]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3370
[#3369]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3369

Expand Down
6 changes: 3 additions & 3 deletions docs/rules/jsx-sort-props.md
Expand Up @@ -125,8 +125,8 @@ This can be a boolean or an array option.
When `reservedFirst` is defined, React reserved props (`children`, `dangerouslySetInnerHTML` - **only for DOM components**, `key`, and `ref`) must be listed before all other props, but still respecting the alphabetical order:

```jsx
<Hello key={0} ref="John" name="John">
<div dangerouslySetInnerHTML={{__html: 'ESLint Plugin React!'}} ref="dangerDiv" />
<Hello key={0} ref={johnRef} name="John">
<div dangerouslySetInnerHTML={{__html: 'ESLint Plugin React!'}} ref={dangerDivRef} />
</Hello>
```

Expand All @@ -135,7 +135,7 @@ If given as an array, the array's values will override the default list of reser
With `reservedFirst: ["key"]`, the following will **not** warn:

```jsx
<Hello key={'uuid'} name="John" ref="ref" />
<Hello key={'uuid'} name="John" ref={johnRef} />
```

### `locale`
Expand Down

0 comments on commit 3d58253

Please sign in to comment.