a note: eslint react hook rules don't complain about a state setter created by setState as a missing dependency as it never changes. So while it doesn't hurt, an empty dependencies array would work just fine in this case.
Sounds good. I would put anything I use into dependencies for consistency but it’s a good note for those who feels better when the dependencies array is empty. Thank you!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
a note: eslint react hook rules don't complain about a state setter created by
setState
as a missing dependency as it never changes. So while it doesn't hurt, an empty dependencies array would work just fine in this case.Sounds good. I would put anything I use into dependencies for consistency but it’s a good note for those who feels better when the dependencies array is empty. Thank you!