Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
5b9a2ce
Upgrade babel-plugin-react-compiler (#7985)
poteto Sep 16, 2025
a566d87
Add copyright script (#7991)
poteto Sep 18, 2025
bd03b86
Update copyright on all files (#7992)
poteto Sep 18, 2025
b6a32d1
Add local eslint rule to validate markdown codeblocks with React Comp…
poteto Sep 18, 2025
5cc9b7b
fix compiler errors (#7989)
poteto Sep 18, 2025
2a9ef2d
Revert "fix compiler errors (#7989)" (#7995)
poteto Sep 18, 2025
f369f3e
Ignore braces when building Sandpack file map (#7996)
poteto Sep 18, 2025
730d045
Restore lint corrections from #7989 (#7997)
poteto Sep 18, 2025
c15e20f
Install eslint-local-rules as postinstall (#7993)
poteto Sep 19, 2025
366b5fb
Add new eslint rule reference docs (#7986)
poteto Sep 19, 2025
c8211fc
Add RC badge to RC-only lint rules (#8005)
rickhanlonii Sep 22, 2025
170e5b9
Remove unnecessary spaces from useCallback.md (#8006)
rammba Sep 23, 2025
790625f
Fix ViewTransition examples (#7999)
EugeneChoi4 Sep 23, 2025
1b20061
Fix value wrongly formatted as code in useDeferredValue.md (#8024)
rammba Sep 26, 2025
49c2d26
Update useEffectEvent docs for canary (#8025)
jackpope Sep 28, 2025
c60922f
Fix incorrect negative in use-memo intro (#8027)
karlhorky Oct 1, 2025
3f0235b
Docs for `cacheSignal` (#8023)
eps1lon Oct 1, 2025
9fddeca
docs: initial docs for Performance tracks (#7938)
hoxyq Oct 1, 2025
aba6b86
Docs for partial-prerendering APIs (#7869)
rickhanlonii Oct 1, 2025
10e5ad5
Conditionally deriving state is allowed (#8033)
gaearon Oct 1, 2025
dc86f88
Overview for React Server Performance tracks (#8031)
eps1lon Oct 1, 2025
c3d7560
Blog post for React 19.2 (#8028)
rickhanlonii Oct 1, 2025
0a803f6
Update eslint-plugin-react-hooks config docs (#8030)
jackpope Oct 1, 2025
f9fd07c
Fix Activity sandboxes (#8035)
rickhanlonii Oct 1, 2025
37f862a
Latest release is 19.2 (#8040)
eps1lon Oct 2, 2025
9850724
Upgrade sandboxes to 19.2 (#8037)
gaearon Oct 2, 2025
42037e2
Few cleanups for 19.2 (#8046)
rickhanlonii Oct 2, 2025
07b7a5d
s/19.3/19.2
rickhanlonii Oct 2, 2025
996ef72
Prerender can be aborted in stable (#8039)
eps1lon Oct 2, 2025
775d895
fix typo
sophiebits Oct 3, 2025
ae584af
Add experimental docs for Fragment refs (#8010)
jackpope Oct 3, 2025
7b8612e
Update eslint-plugin-react-hooks version reference (#8051)
poteto Oct 3, 2025
11cb6b5
Clarify eslint-plugin-react-hooks configuration details (#8052)
poteto Oct 4, 2025
28e9bd9
Document React's profiling build (#8054)
eps1lon Oct 6, 2025
2495353
Bump ViewTransition and Fragment ref docs to canary (#8048)
eps1lon Oct 7, 2025
d9e3504
Add React Foundation blog post (#8057)
mattcarrollcode Oct 7, 2025
8d73630
Upgrade to stable react compiler (#8058)
poteto Oct 7, 2025
ef80db8
Fix broken tabs (#8063)
poteto Oct 8, 2025
ec27355
Fix grammatical error in ViewTransition documentation (#8068)
Caisere Oct 9, 2025
be77c2a
React Compiler v1 (#8065)
poteto Oct 10, 2025
6346efd
Reorder compiler post a bit (#8071)
gaearon Oct 11, 2025
16e97fa
Fix server/client typo in <form> docs (#6627)
mdj-uk Oct 11, 2025
7e24db5
fix: correct example link to minified error on /errors index page (#8…
SecondThundeR Oct 11, 2025
0d05d9b
Revert "Reorder compiler post a bit (#8071)" (#8074)
gaearon Oct 11, 2025
02ecded
Update caveats for Activity rendering behavior (#8067)
TkDodo Oct 13, 2025
a677ba3
Fragment refs - Remove unused ref from focus fragment example (#8056)
slorber Oct 13, 2025
9ef1c47
fix: Breaking up a sentence to make it easier to understand (#8078)
moijes12 Oct 15, 2025
c8843f7
docs: capitalize Error Boundary concept across docs (#6713) (#8077)
Yonas650 Oct 16, 2025
ac0d53e
docs: update recommended full-stack React framework from Remix to Rea…
ardi-zanki Oct 16, 2025
55e37af
Update conference listings for 2025 and 2026 (#8069)
arismarko Oct 16, 2025
44e94f3
Fix typo in useRef.md (#8060)
gramsco Oct 16, 2025
4b92001
Fix typo in Comments component (#7258)
sachanritik1 Oct 16, 2025
593fa1c
docs: fix symbol in prerenderToNodeStream.md (#8019)
WuMingDao Oct 16, 2025
df75927
docs: fix server components link text to match target section heading…
alejorrojas Oct 16, 2025
7571898
Fix cat scrolling example (#7980)
kenkam Oct 16, 2025
6cb7fea
Update hooks link to /reference/react/hooks in /reference/react/api…
WuMingDao Oct 16, 2025
ee5b672
Fix ordered list numbering in useCallback.md (#8011)
rammba Oct 16, 2025
f93cb2e
doc: Update from /react to /react/hooks in /reference/react-dom/hooks…
WuMingDao Oct 16, 2025
896a689
Remove ReactConf notes in blogs (#8082)
rickhanlonii Oct 16, 2025
fe87df5
clarify SRP definition (#8008)
0xPxt Oct 16, 2025
7ecf008
Add React Conf 2025 recap blog post (#8079)
mattcarrollcode Oct 16, 2025
f8c81a0
Use stable activity imports (#8085)
jackpope Oct 18, 2025
4b0935b
Add `<Activity>` bullet to built-in components section (#8087)
imjordanxd Oct 20, 2025
2c7798d
Fix typo in react compiler blog post date (#8091)
poteto Oct 20, 2025
c0af2d0
Add note on error boundary limitations (#8108)
JayCeeKay1991 Oct 29, 2025
e57e912
docs(blog): Add 'React 19.2' to blog sidebar (#8113)
SeungJin051 Oct 31, 2025
f9e2c13
Remove 'esquery' hack to potentially enable Turbopack (#8115)
joshwcomeau Nov 1, 2025
f020b53
docs: add missing 'Static APIs' link to React DOM reference page (#8127)
martinrebo Nov 5, 2025
5c632dc
Nit: wording
gaearon Nov 5, 2025
9c0763d
fix: correct links for Redwood and TanStack (#8121)
clicktodev Nov 5, 2025
abd1fe0
docs: Remove redundant symbols ‘ “ ’ (#8101)
WuMingDao Nov 5, 2025
6a70889
Fix typo in childIds array in initialTravelPlan (#8112)
egvr2002 Nov 5, 2025
d271a7a
Fix incorrect condition in "Chains of computations" example (#8109)
PaulyBearCoding Nov 6, 2025
856ebae
merging all conflicts
react-translations-bot Nov 10, 2025
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
Prev Previous commit
Next Next commit
Update eslint-plugin-react-hooks config docs (#8030)
We're updating eslint-plugin-react-hooks with support for useEffectEvent usage and updated configuration options for applying the useEffectEvent and other effect rules to custom effect hooks.

This adds the documentation for the config syntax and adds mention to the useEffectEvent reference page that the linter should be used to ensure proper usage of Effect Events.
  • Loading branch information
jackpope authored Oct 1, 2025
commit 0a803f61d84723e87f2481f31ea77da9606664c9
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,21 @@ useEffect(() => {

## Options {/*options*/}

This rule accepts an options object:
You can configure custom effect hooks using shared ESLint settings (available in `eslint-plugin-react-hooks` 6.1.0 and later):

```js
{
"settings": {
"react-hooks": {
"additionalEffectHooks": "(useMyEffect|useCustomEffect)"
}
}
}
```

- `additionalEffectHooks`: Regex pattern matching custom hooks that should be checked for exhaustive dependencies. This configuration is shared across all `react-hooks` rules.

For backward compatibility, this rule also accepts a rule-level option:

```js
{
Expand All @@ -152,4 +166,4 @@ This rule accepts an options object:
}
```

- `additionalHooks`: Regex for hooks that should be checked for exhaustive dependencies
- `additionalHooks`: Regex for hooks that should be checked for exhaustive dependencies. **Note:** If this rule-level option is specified, it takes precedence over the shared `settings` configuration.
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,21 @@ const [permissions, setPermissions] = useState(
userType === 'admin' ? adminPerms : userPerms
);
```

## Options {/*options*/}

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

```js
{
"settings": {
"react-hooks": {
"additionalEffectHooks": "(useMyEffect|useCustomEffect)"
}
}
}
```

- `additionalEffectHooks`: Regex pattern matching custom hooks that should be treated as effects. This allows `useEffectEvent` and similar event functions to be called from your custom effect hooks.

This shared configuration is used by both `rules-of-hooks` and `exhaustive-deps` rules, ensuring consistent behavior across all hook-related linting.
6 changes: 4 additions & 2 deletions src/content/reference/react/useEffectEvent.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Returns an Effect Event function. You can call this function inside `useEffect`,

#### Caveats {/*caveats*/}

- **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.
- **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.
- **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.
- **Use for non-reactive logic:** Only use `useEffectEvent` to extract logic that does not depend on changing values.

Expand Down Expand Up @@ -88,5 +88,7 @@ function Page({ url }) {
}
```

You can pass reactive values like `url` as arguments to the Effect Event. This lets you access the latest values without making your Effect re-run for every change.
In this example, the Effect should re-run after a render when `url` changes (to log the new page visit), but it should **not** re-run when `numberOfItems` changes. By wrapping the logging logic in an Effect Event, `numberOfItems` becomes non-reactive. It's always read from the latest value without triggering the Effect.

You can pass reactive values like `url` as arguments to the Effect Event to keep them reactive while accessing the latest non-reactive values inside the event.