loading...

re: 3 React Mistakes Junior Developers Make With Component State VIEW POST

TOP OF THREAD FULL DISCUSSION
re: I'm completely new to React so thank you for the explanations! And how to do things properly. But I have a question if you would be so kind to repl...
 

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.

 

Yep! That's exactly right.

code of conduct - report abuse