|
| 1 | +/** |
| 2 | + * Copyright (c) Meta Platforms, Inc. and affiliates. |
| 3 | + * |
| 4 | + * This source code is licensed under the MIT license found in the |
| 5 | + * LICENSE file in the root directory of this source tree. |
| 6 | + * |
| 7 | + * @flow |
| 8 | + */ |
| 9 | + |
| 10 | +// Renderers that don't support view transitions |
| 11 | +// can re-export everything from this module. |
| 12 | + |
| 13 | +function shim(...args: any): empty { |
| 14 | + throw new Error( |
| 15 | + 'The current renderer does not support view transitions. ' + |
| 16 | + 'This error is likely caused by a bug in React. ' + |
| 17 | + 'Please file an issue.', |
| 18 | + ); |
| 19 | +} |
| 20 | + |
| 21 | +// View Transitions (when unsupported) |
| 22 | +export const supportsViewTransition = false; |
| 23 | +export const applyViewTransitionName = shim; |
| 24 | +export const restoreViewTransitionName = shim; |
| 25 | +export const cancelViewTransitionName = shim; |
| 26 | +export const cancelRootViewTransitionName = shim; |
| 27 | +export const restoreRootViewTransitionName = shim; |
| 28 | +export const cloneRootViewTransitionContainer = shim; |
| 29 | +export const removeRootViewTransitionClone = shim; |
| 30 | +export type InstanceMeasurement = null; |
| 31 | +export const measureInstance = shim; |
| 32 | +export const measureClonedInstance = shim; |
| 33 | +export const wasInstanceInViewport = shim; |
| 34 | +export const hasInstanceChanged = shim; |
| 35 | +export const hasInstanceAffectedParent = shim; |
| 36 | +export const startViewTransition = shim; |
| 37 | +export type RunningViewTransition = null; |
| 38 | +export const startGestureTransition = shim; |
| 39 | +export const stopViewTransition = shim; |
| 40 | +export const addViewTransitionFinishedListener = shim; |
| 41 | +export type ViewTransitionInstance = null | {name: string, ...}; |
| 42 | +export const createViewTransitionInstance = shim; |
0 commit comments