dillon1000/react

Commit

Use performConcurrentWorkOnRoot for "sync default" (#21322)

Instead of `performSyncWorkOnRoot`.

The conceptual model is that the only difference between sync default
updates (in React 18) and concurrent default updates (in a future major
release) is time slicing. All other behavior should be the same
(i.e. the stuff in `finishConcurrentRender`).

Given this, I think it makes more sense to model the implementation this
way, too. This exposed a quirk in the previous implementation where
non-sync work was sometimes mistaken for sync work and flushed too
early. In the new implementation, `performSyncWorkOnRoot` is only used
for truly synchronous renders (i.e. `SyncLane`), which should make these
mistakes less common.

Fixes most of the tests marked with TODOs from #21072.
Browse files
Changed paths9 files
First-parent comparison
M packages/react-reconciler/src/ReactFiberLane.new.js ModifiedM packages/react-reconciler/src/ReactFiberLane.old.js ModifiedM packages/react-reconciler/src/ReactFiberWorkLoop.new.js ModifiedM packages/react-reconciler/src/ReactFiberWorkLoop.old.js ModifiedM packages/react-reconciler/src/__tests__/ReactExpiration-test.js ModifiedM packages/react-reconciler/src/__tests__/ReactFlushSync-test.js ModifiedM packages/react-reconciler/src/__tests__/ReactHooksWithNoopRenderer-test.js ModifiedM packages/react-reconciler/src/__tests__/ReactIncrementalUpdates-test.js ModifiedM packages/react-reconciler/src/__tests__/useMutableSource-test.internal.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…