dillon1000/react

Commit

setState() in componentDidMount() should flush synchronously even with createBatch() (#12466)

* Add a failing test for setState in cDM during batch.commit()

* Copy pasta

* Flush all follow-up Sync work on the committed batch

* Nit: Use performSyncWork

Call performSyncWork right after flushing the batch. Does effectively
the same thing by reusing the existing function.

Also added some comments.

* Delete accidentally duplicated test
Browse files
Changed paths2 files
First-parent comparison
M packages/react-dom/src/__tests__/ReactDOMRoot-test.internal.js ModifiedM packages/react-reconciler/src/ReactFiberScheduler.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…