Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 13 additions & 0 deletions packages/eslint-plugin-react-hooks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,19 @@ This option accepts a regex to match the names of custom Hooks that have depende
}
```

**Warning**: The regex matches the hook name anywhere in the identifier. To avoid unintended matches (e.g., `useMyCustomHook2`), use word boundaries:

```js
{
rules: {
// ...
"react-hooks/exhaustive-deps": ["warn", {
additionalHooks: "\\b(useMyCustomHook|useMyOtherCustomHook)\\b"
}]
}
}
```

We suggest to use this option **very sparingly, if at all**. Generally saying, we recommend most custom Hooks to not use the dependencies argument, and instead provide a higher-level API that is more focused around a specific use case.

## Valid and Invalid Examples
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default function NoProfilingData(): React.Node {
Click{' '}
<a
className={styles.LearnMoreLink}
href="https://fb.me/react-devtools-profiling"
href="https://react.dev/reference/profiler"
rel="noopener noreferrer"
target="_blank">
here
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ export default function ProfilingNotSupported(): React.Node {
Learn more at{' '}
<a
className={styles.Link}
href="https://fb.me/react-devtools-profiling"
href="https://react.dev/reference/profiler"
rel="noopener noreferrer"
target="_blank">
reactjs.org/link/profiling
react.dev/reference/profiler
</a>
.
</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function UnknownUnsupportedReason() {
Click{' '}
<a
className={styles.Link}
href="https://fb.me/react-devtools-profiling"
href="https://react.dev/reference/profiler"
rel="noopener noreferrer"
target="_blank">
here
Expand Down