diff --git a/packages/eslint-plugin-react-hooks/README.md b/packages/eslint-plugin-react-hooks/README.md index a1b4bcabb59f..b13d09337e7e 100644 --- a/packages/eslint-plugin-react-hooks/README.md +++ b/packages/eslint-plugin-react-hooks/README.md @@ -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 diff --git a/packages/react-devtools-shared/src/devtools/views/Profiler/NoProfilingData.js b/packages/react-devtools-shared/src/devtools/views/Profiler/NoProfilingData.js index 5e6c39b28ce3..21abe88af3c1 100644 --- a/packages/react-devtools-shared/src/devtools/views/Profiler/NoProfilingData.js +++ b/packages/react-devtools-shared/src/devtools/views/Profiler/NoProfilingData.js @@ -23,7 +23,7 @@ export default function NoProfilingData(): React.Node { Click{' '} here diff --git a/packages/react-devtools-shared/src/devtools/views/Profiler/ProfilingNotSupported.js b/packages/react-devtools-shared/src/devtools/views/Profiler/ProfilingNotSupported.js index 8799a29d02fb..55aa72789b7e 100644 --- a/packages/react-devtools-shared/src/devtools/views/Profiler/ProfilingNotSupported.js +++ b/packages/react-devtools-shared/src/devtools/views/Profiler/ProfilingNotSupported.js @@ -23,10 +23,10 @@ export default function ProfilingNotSupported(): React.Node { Learn more at{' '} - reactjs.org/link/profiling + react.dev/reference/profiler .

diff --git a/packages/react-devtools-timeline/src/TimelineNotSupported.js b/packages/react-devtools-timeline/src/TimelineNotSupported.js index 7eac79da94f5..8b781ed51561 100644 --- a/packages/react-devtools-timeline/src/TimelineNotSupported.js +++ b/packages/react-devtools-timeline/src/TimelineNotSupported.js @@ -58,7 +58,7 @@ function UnknownUnsupportedReason() { Click{' '} here