Skip to content

Commit e5ebd2e

Browse files
committed
Ensure we flush gesture rendering in the microtask of the starting event
1 parent 8d2bb78 commit e5ebd2e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/react-reconciler/src/ReactFiberRootScheduler.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
enableComponentPerformanceTrack,
2121
enableSiblingPrerendering,
2222
enableYieldingBeforePassive,
23+
enableSwipeTransition,
2324
} from 'shared/ReactFeatureFlags';
2425
import {
2526
NoLane,
@@ -32,6 +33,7 @@ import {
3233
claimNextTransitionLane,
3334
getNextLanesToFlushSync,
3435
checkIfRootIsPrerendering,
36+
isGestureRender,
3537
} from './ReactFiberLane';
3638
import {
3739
CommitContext,
@@ -211,7 +213,8 @@ function flushSyncWorkAcrossRoots_impl(
211213
rootHasPendingCommit,
212214
);
213215
if (
214-
includesSyncLane(nextLanes) &&
216+
(includesSyncLane(nextLanes) ||
217+
(enableSwipeTransition && isGestureRender(nextLanes))) &&
215218
!checkIfRootIsPrerendering(root, nextLanes)
216219
) {
217220
// This root has pending sync work. Flush it now.
@@ -296,7 +299,8 @@ function processRootScheduleInMicrotask() {
296299
syncTransitionLanes !== NoLanes ||
297300
// Common case: we're not treating any extra lanes as synchronous, so we
298301
// can just check if the next lanes are sync.
299-
includesSyncLane(nextLanes)
302+
includesSyncLane(nextLanes) ||
303+
(enableSwipeTransition && isGestureRender(nextLanes))
300304
) {
301305
mightHavePendingSyncWork = true;
302306
}

0 commit comments

Comments
 (0)