Skip to content

Commit 7b8612e

Browse files
authored
Update eslint-plugin-react-hooks version reference (#8051)
Updates all mentions of eslint-plugin-react-hooks rc and 6.1.0 to refer to the new 6.1.1 which has important bugfixes.
1 parent ae584af commit 7b8612e

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

src/content/blog/2025/04/21/react-compiler-rc.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,23 +57,23 @@ During the RC period, we encourage all React users to try the compiler and provi
5757
As noted in the Beta announcement, React Compiler is compatible with React 17 and up. If you are not yet on React 19, you can use React Compiler by specifying a minimum target in your compiler config, and adding `react-compiler-runtime` as a dependency. You can find docs on this [here](https://react.dev/learn/react-compiler#using-react-compiler-with-react-17-or-18).
5858

5959
## Migrating from eslint-plugin-react-compiler to eslint-plugin-react-hooks {/*migrating-from-eslint-plugin-react-compiler-to-eslint-plugin-react-hooks*/}
60-
If you have already installed eslint-plugin-react-compiler, you can now remove it and use `eslint-plugin-react-hooks@rc`. Many thanks to [@michaelfaith](https://bsky.app/profile/michael.faith) for contributing to this improvement!
60+
If you have already installed eslint-plugin-react-compiler, you can now remove it and use `eslint-plugin-react-hooks@^6.1.1`. Many thanks to [@michaelfaith](https://bsky.app/profile/michael.faith) for contributing to this improvement!
6161

6262
To install:
6363

6464
npm
6565
<TerminalBlock>
66-
{`npm install --save-dev eslint-plugin-react-hooks@rc`}
66+
{`npm install --save-dev eslint-plugin-react-hooks@^6.1.1`}
6767
</TerminalBlock>
6868

6969
pnpm
7070
<TerminalBlock>
71-
{`pnpm add --save-dev eslint-plugin-react-hooks@rc`}
71+
{`pnpm add --save-dev eslint-plugin-react-hooks@^6.1.1`}
7272
</TerminalBlock>
7373

7474
yarn
7575
<TerminalBlock>
76-
{`yarn add --dev eslint-plugin-react-hooks@rc`}
76+
{`yarn add --dev eslint-plugin-react-hooks@^6.1.1`}
7777
</TerminalBlock>
7878

7979
```js

src/content/blog/2025/10/01/react-19-2.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ function ChatRoom({ roomId, theme }) {
9898
9999
Similar to DOM events, Effect Events always “see” the latest props and state.
100100
101-
**Effect Events should _not_ be declared in the dependency array**. You'll need to upgrade to `eslint-plugin-react-hooks@6.1.0` so that the linter doesn't try to insert them as dependencies. Note that Effect Events can only be declared in the same component or Hook as "their" Effect. These restrictions are verified by the linter.
101+
**Effect Events should _not_ be declared in the dependency array**. You'll need to upgrade to `eslint-plugin-react-hooks@6.1.1` so that the linter doesn't try to insert them as dependencies. Note that Effect Events can only be declared in the same component or Hook as "their" Effect. These restrictions are verified by the linter.
102102
103103
<Note>
104104
@@ -289,7 +289,7 @@ This is because Node Streams are much faster than Web Streams in Node, and Web S
289289
290290
### `eslint-plugin-react-hooks` v6 {/*eslint-plugin-react-hooks*/}
291291
292-
We also published `eslint-plugin-react-hooks@6.1.0` with flat config by default in the `recommended` preset, and opt-in for new React Compiler powered rules.
292+
We also published `eslint-plugin-react-hooks@6.1.1` with flat config by default in the `recommended` preset, and opt-in for new React Compiler powered rules.
293293
294294
To continue using the legacy config, you can change to `recommended-legacy`:
295295

src/content/learn/react-compiler/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ React Compiler includes an ESLint rule that helps identify code that can't be op
173173
Install the ESLint plugin:
174174

175175
<TerminalBlock>
176-
npm install -D eslint-plugin-react-hooks@rc
176+
npm install -D eslint-plugin-react-hooks@^6.1.1
177177
</TerminalBlock>
178178

179179
If you haven't already configured eslint-plugin-react-hooks, follow the [installation instructions in the readme](https://github.com/facebook/react/blob/main/packages/eslint-plugin-react-hooks/README.md#installation). The compiler rule is enabled by default in the latest RC, so no additional configuration is needed.

src/content/reference/eslint-plugin-react-hooks/lints/exhaustive-deps.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ useEffect(() => {
140140

141141
## Options {/*options*/}
142142

143-
You can configure custom effect hooks using shared ESLint settings (available in `eslint-plugin-react-hooks` 6.1.0 and later):
143+
You can configure custom effect hooks using shared ESLint settings (available in `eslint-plugin-react-hooks` 6.1.1 and later):
144144

145145
```js
146146
{

src/content/reference/eslint-plugin-react-hooks/lints/rules-of-hooks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ const [permissions, setPermissions] = useState(
162162

163163
## Options {/*options*/}
164164

165-
You can configure custom effect hooks using shared ESLint settings (available in `eslint-plugin-react-hooks` 6.1.0 and later):
165+
You can configure custom effect hooks using shared ESLint settings (available in `eslint-plugin-react-hooks` 6.1.1 and later):
166166

167167
```js
168168
{

src/content/reference/react/useEffectEvent.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Returns an Effect Event function. You can call this function inside `useEffect`,
5353

5454
#### Caveats {/*caveats*/}
5555

56-
- **Only call inside Effects:** Effect Events should only be called within Effects. Define them just before the Effect that uses them. Do not pass them to other components or hooks. The [`eslint-plugin-react-hooks`](/reference/eslint-plugin-react-hooks) linter (version 6.1.0 or higher) will enforce this restriction to prevent calling Effect Events in the wrong context.
56+
- **Only call inside Effects:** Effect Events should only be called within Effects. Define them just before the Effect that uses them. Do not pass them to other components or hooks. The [`eslint-plugin-react-hooks`](/reference/eslint-plugin-react-hooks) linter (version 6.1.1 or higher) will enforce this restriction to prevent calling Effect Events in the wrong context.
5757
- **Not a dependency shortcut:** Do not use `useEffectEvent` to avoid specifying dependencies in your Effect's dependency array. This can hide bugs and make your code harder to understand. Prefer explicit dependencies or use refs to compare previous values if needed.
5858
- **Use for non-reactive logic:** Only use `useEffectEvent` to extract logic that does not depend on changing values.
5959

0 commit comments

Comments
 (0)