Skip to content

Commit 0da7164

Browse files
committed
isPreparingViewTransition -> hasPendingCommitEffects
We already had an equivalent helper that we already used in root scheduler.
1 parent 340c94f commit 0da7164

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

packages/react-reconciler/src/ReactFiberRootScheduler.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ import {
4848
hasPendingCommitEffects,
4949
isWorkLoopSuspendedOnData,
5050
performWorkOnRoot,
51-
isPreparingViewTransition,
5251
} from './ReactFiberWorkLoop';
5352
import {LegacyRoot} from './ReactRootTags';
5453
import {
@@ -314,7 +313,7 @@ function processRootScheduleInMicrotask() {
314313
// If we're in the middle of a View Transition async sequence, we don't want to
315314
// interrupt that sequence. Instead, we'll flush any remaining work when it
316315
// completes.
317-
if (!isPreparingViewTransition()) {
316+
if (!hasPendingCommitEffects()) {
318317
flushSyncWorkAcrossRoots_impl(syncTransitionLanes, false);
319318
}
320319
}

packages/react-reconciler/src/ReactFiberWorkLoop.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -677,10 +677,6 @@ let pendingTransitionTypes: null | TransitionTypes = null;
677677
let pendingDidIncludeRenderPhaseUpdate: boolean = false;
678678
let pendingSuspendedCommitReason: SuspendedCommitReason = IMMEDIATE_COMMIT; // Profiling-only
679679

680-
export function isPreparingViewTransition(): boolean {
681-
return enableViewTransition && pendingViewTransition !== null;
682-
}
683-
684680
// Use these to prevent an infinite loop of nested updates
685681
const NESTED_UPDATE_LIMIT = 50;
686682
let nestedUpdateCount: number = 0;

0 commit comments

Comments
 (0)