dillon1000/react
Commit
Browse files Fix: Don't flush discrete at end of batchedUpdates (#21229)
The outermost `batchedUpdates` call flushes pending sync updates at the end. This was intended for legacy sync mode, but it also happens to flush discrete updates in concurrent mode. Instead, we should only flush sync updates at the end of `batchedUpdates` for legacy roots. Discrete sync updates can wait to flush in the microtask. `discreteUpdates` has the same issue, which is how I originally noticed this, but I'll change that one in a separate commit since it requires updating a few (no longer relevant) internal tests.
Changed paths8 files
First-parent comparisonpackages/react-devtools-shared/src/__tests__/storeStressTestConcurrent-test.js ModifiedM packages/react-dom/src/__tests__/ReactDOMNativeEventHeuristic-test.js ModifiedM packages/react-reconciler/src/ReactFiberSyncTaskQueue.new.js ModifiedM packages/react-reconciler/src/ReactFiberSyncTaskQueue.old.js ModifiedM packages/react-reconciler/src/ReactFiberWorkLoop.new.js ModifiedM packages/react-reconciler/src/ReactFiberWorkLoop.old.js ModifiedM packages/react-reconciler/src/__tests__/ReactFiberHostContext-test.internal.js ModifiedM packages/react-reconciler/src/__tests__/ReactIncrementalTriangle-test.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…