MCPcopy
hub / github.com/facebook/react / flushPendingEffects

Function flushPendingEffects

packages/react-reconciler/src/ReactFiberWorkLoop.js:4423–4450  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4421}
4422
4423export function flushPendingEffects(): boolean {
4424 // Returns whether passive effects were flushed.
4425 if (enableViewTransition && pendingViewTransition !== null) {
4426 // If we forced a flush before the View Transition full started then we skip it.
4427 // This ensures that we're not running a partial animation.
4428 stopViewTransition(pendingViewTransition);
4429 if (__DEV__) {
4430 if (!didWarnAboutInterruptedViewTransitions) {
4431 didWarnAboutInterruptedViewTransitions = true;
4432 console.warn(
4433 'A flushSync update cancelled a View Transition because it was called ' +
4434 'while the View Transition was still preparing. To preserve the synchronous ' +
4435 'semantics, React had to skip the View Transition. If you can, try to avoid ' +
4436 "flushSync() in a scenario that's likely to interfere.",
4437 );
4438 }
4439 }
4440 pendingViewTransition = null;
4441 pendingDelayedCommitReason = ABORTED_VIEW_TRANSITION_COMMIT;
4442 }
4443 flushGestureMutations();
4444 flushGestureAnimations();
4445 flushMutationEffects();
4446 flushLayoutEffects();
4447 // Skip flushAfterMutation if we're forcing this early.
4448 flushSpawnedWork();
4449 return flushPassiveEffects();
4450}
4451
4452function flushPassiveEffects(): boolean {
4453 if (pendingEffectsStatus !== PENDING_PASSIVE_PHASE) {

Callers 7

updateContainerSyncFunction · 0.90
performSyncWorkOnRootFunction · 0.90
scheduleRefreshFunction · 0.90
flushSyncFromReconcilerFunction · 0.85
commitRootFunction · 0.85
flushSpawnedWorkFunction · 0.85

Calls 7

stopViewTransitionFunction · 0.90
flushGestureMutationsFunction · 0.85
flushGestureAnimationsFunction · 0.85
flushMutationEffectsFunction · 0.85
flushLayoutEffectsFunction · 0.85
flushSpawnedWorkFunction · 0.85
flushPassiveEffectsFunction · 0.85

Tested by

no test coverage detected