DEV Community

Discussion on: 3 React Mistakes Junior Developers Make With Component State

kaushal18 profile image
kaushal yadav • Edited on

use functions when you rely on previous state values, like toggle button, increment counter, etc. It's okay to use objects when the new state is independent of previous (like in #3). Correct me I'm wrong.

thawkin3 profile image
Tyler Hawkins Author

Yep! That's exactly right.