8 Best Practices Every React Developer Should Follow
Tips for writing better React code
Published in
6 min readOct 12, 2021
1. Use Callback Syntax of State Updation
When the next state of a component depends on the previous state, always pass a function to the setState
and don’t set the state directly. Here’s some code showing you why: