3 ms·
I’m saying that if you have multiple pieces of state that must be updated atomically, it makes sense to store them in an object in one useState hook because it
by jakelazaroff 5y ago
I’m saying that if you have multiple pieces of state that must be updated atomically, it makes sense to store them in an object in one useState hook because it signals to other developers that they should be updated together. The fact that React allows you to batch the renders if you store the state in two separate hooks is unimportant.