Skip to content

Commit dba26d9

Browse files
authored
Replacing ref string with ref variable
1 parent 9055439 commit dba26d9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/rules/jsx-sort-props.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ This can be a boolean or an array option.
125125
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:
126126

127127
```jsx
128-
<Hello key={0} ref="John" name="John">
129-
<div dangerouslySetInnerHTML={{__html: 'ESLint Plugin React!'}} ref="dangerDiv" />
128+
<Hello key={0} ref={johnRef} name="John">
129+
<div dangerouslySetInnerHTML={{__html: 'ESLint Plugin React!'}} ref={dangerDivRef} />
130130
</Hello>
131131
```
132132

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

137137
```jsx
138-
<Hello key={'uuid'} name="John" ref="ref" />
138+
<Hello key={'uuid'} name="John" ref={johnRef} />
139139
```
140140

141141
### `locale`

0 commit comments

Comments
 (0)