4 ms·
One reason for the explicit method may be that React does an internal optimization where it batches state updates together. Two calls to setState can result in
by lopatin 11y ago
One reason for the explicit method may be that React does an internal optimization where it batches state updates together. Two calls to setState can result in just one render.
https://groups.google.com/forum/#!msg/reactjs/R61kPjs-yXE/ysmpC0IvA4YJ https://groups.google.com/forum/#!msg/reactjs/R61kPjs-yXE/ys...
- masklinn 11y agoNo reason why this wouldn't be possible with Observe, the first call schedules a re-render and the next one doesn't do anything since there's already a re-render scheduled.