dillon1000/react

Commit

Batch updates in initial render

Currently, the first setState that happens during initial render will
start a new batch. Any subsequent updates will be batched. That means that
the first setState is synchronous but any subsequent setStates are
asynchronous.

This commit makes it so that the batching starts at the root. That way all
the setStates that happen within life-cycle methods are asynchronous.
Browse files
Changed paths5 files
First-parent comparison
M src/addons/ReactRAFBatchingStrategy.js ModifiedM src/browser/ui/ReactMount.js ModifiedM src/core/ReactDefaultBatchingStrategy.js ModifiedM src/core/ReactUpdates.js ModifiedM src/core/__tests__/ReactCompositeComponentState-test.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…