react
react copied to clipboard
Bug: eslint-plugin-react-hooks documentation might be misleading
Splits from https://github.com/WordPress/gutenberg/issues/61598 & https://github.com/WordPress/gutenberg/pull/61599
The current explanation about "additionalHooks" under react-hooks/exhaustive-deps
might be misleading. The regex in the example catches more than needed.
This:
"additionalHooks": "(useMyCustomHook|useMyOtherCustomHook)"
Will catch also things like this:
function App() {
const data1 = useMyCustomHook2();
const data2 = useMyOtherCustomHookTest();
// ...
}
This might be the reason why Gutenberg used the same approach (which caused the bug mentioned above): https://github.com/WordPress/gutenberg/blob/2df566c771dba22eec2841081a00963a2e56658c/packages/eslint-plugin/configs/react.js#L37-L42
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!
Bump