When does React batch state
December 23, 2021
We learned before that React states sometimes get batched together into one single state update instead of individual update. But some other times this is not the case.
We learned before that React states sometimes get batched together into one single state update instead of individual update. But some other times this is not the case.
When multiple states are updated, chance is that they are not updated one by one. Instead, they are batched together and updated all at once
If you use React Hooks before, you are probably familiar with using `setState` by passing the new value you want the state to update to to it. But do you know that it has a functional form?