()
| 4421 | } |
| 4422 | |
| 4423 | export 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 | |
| 4452 | function flushPassiveEffects(): boolean { |
| 4453 | if (pendingEffectsStatus !== PENDING_PASSIVE_PHASE) { |
no test coverage detected