DEV Community

Discussion on: How not to update states in React!!

Collapse
 
nehal_mahida profile image
Nehal Mahida

Thanks, man, You put great points 🙏🏻

Trust me it adds value to my post.

Regarding the title, Yes the first approach works most of the time.
But don't you think if programmers follow the second approach from starting itself, they don't need to worry about state updates ( asynchronous or synchronous) at the end?

As the world moves towards pair or group programming it is a good habit to make a RIGHT approach a default one. 🤗

Happy Coding!!