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!
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.