DEV Community

Discussion on: Don't be too dependent on useState, useRef is there for you

Collapse
 
lexlohr profile image
Alex Lohr

On one hand, you're reducing the usage of state, on the other you're making it harder for other maintainers, if there are any. Especially if there are side effects that should influence the state (e.g. a server-side confirmation about the toggle), you'll switch back to state anyways.

You still have a point: don't overuse state - and make your state as dumb as possible. It'll save trouble in the long run.