loading...

re: Update boolean state right with React Hooks VIEW POST

FULL DISCUSSION
 

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!

code of conduct - report abuse