-
Notifications
You must be signed in to change notification settings - Fork 47k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: eslint-plugin-react-hooks: Incorrect dependency requirement when using typeof
on nested data structures
#27335
Comments
Perhaps the fix in #19316 wasn't quite right and needs to skip if TSTypeAnnotation is anywhere in the ancestors. |
Yes, correct @sophiebits the type checking should not be only just for the single parent of dependencynode |
Go for it! |
Great! Thanks |
Hi @sophiebits actually need some help. like how to use my local react repo as a dependency in my local project to test out the changes. it would be really helpful if you could guide me on this. |
Figured out. :) |
Raised the PR @sophiebits and its ready for review |
This issue seems related to #18828, but it's not identical. Using
typeof
on a primitive value seems to work as expected, but it fails for nested property access.Version:
[email protected]
Steps To Reproduce
The current behavior
This effect clearly doesn't have external (value) dependencies, but I get this:
The expected behavior
Using
typeof
never leads to a dependency requirement, just like in this example doesn't:The text was updated successfully, but these errors were encountered: