Skip to content
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] false trigger for primitive states that are passed from parent component #2

Open
GorvGoyl opened this issue Mar 11, 2024 · 0 comments

Comments

@GorvGoyl
Copy link

if I pass a primitive state from a parent component to child component and use that state in useEffect, your eslint rules triggers a false error: React Hook useEffect has an object in its dependency array: 'hover'. Non-primitive dependencies can result in triggering the callback unnecessarily due to referential equality comparison. Consider destructuring the object outside the useEffect call or using property accessors to refer to primitive values within the dependency array.eslint[react-hooks-unreliable-deps/reference-deps](https://www.benmvp.com/blog/object-array-dependencies-react-useEffect-hook/)

screenshot 2024-03-11 at 12 47 11@2x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant