dillon1000/react
Commit
Browse files 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
Changed paths2 files
First-parent comparisonpackages/react-dom/src/__tests__/ReactDOMRoot-test.internal.js ModifiedM packages/react-reconciler/src/ReactFiberScheduler.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…