Skip to content

Commit efe355f

Browse files
committed
implement function createViewTransitionInstance
1 parent 655affb commit efe355f

1 file changed

Lines changed: 23 additions & 1 deletion

File tree

packages/react-native-renderer/src/ReactFiberConfigFabricWithViewTransition.js

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,26 @@ export type RunningViewTransition = {
4040
...
4141
};
4242

43+
interface ViewTransitionPseudoElementType extends mixin$Animatable {
44+
_scope: HTMLElement;
45+
_selector: string;
46+
getComputedStyle(): CSSStyleDeclaration;
47+
}
48+
49+
function ViewTransitionPseudoElement(
50+
this: ViewTransitionPseudoElementType,
51+
pseudo: string,
52+
name: string,
53+
) {
54+
// TODO: Get the owner document from the root container.
55+
this._pseudo = pseudo;
56+
this._name = name;
57+
}
58+
4359
export type ViewTransitionInstance = null | {
4460
name: string,
61+
old: mixin$Animatable,
62+
new: mixin$Animatable,
4563
...
4664
};
4765

@@ -179,7 +197,11 @@ export function addViewTransitionFinishedListener(
179197
export function createViewTransitionInstance(
180198
name: string,
181199
): ViewTransitionInstance {
182-
return {name};
200+
return {
201+
name,
202+
old: new (ViewTransitionPseudoElement: any)('old', name),
203+
new: new (ViewTransitionPseudoElement: any)('new', name),
204+
};
183205
}
184206

185207
export function applyViewTransitionName(

0 commit comments

Comments
 (0)