Bug: 'exhaustive-deps' lint rule warns that "Outer scope values" aren't valid when a hook is inside a function #25958
Labels
Status: Unconfirmed
A potential issue that we haven't yet confirmed as a bug
React version: 18.1.0
Steps To Reproduce
Inside a functional component, an inner function with a dependency on value from an outer function triggers the warning, "Outer scope values like '....' aren't valid dependencies because mutating them doesn't re-render the component."
Here's the crux of the problem
Link to code example: https://codesandbox.io/s/custom-hook-repro-3wfly
The current behavior
The eslint rule will complain about unneccessary dependencies.
The expected behavior
The eslint rule shouldn't be triggered.
This is a reopen and copy of #17060 by @gerrod
The text was updated successfully, but these errors were encountered: