@@ -67,6 +67,20 @@ export function trackAppearingViewTransition(
6767 appearingViewTransitions . set ( name , state ) ;
6868}
6969
70+ export function trackEnterViewTransitions ( placement : Fiber ) : void {
71+ if (
72+ placement . tag === ViewTransitionComponent ||
73+ ( placement . subtreeFlags & ViewTransitionStatic ) !== NoFlags
74+ ) {
75+ // If an inserted or appearing Fiber is a ViewTransition component or has one as
76+ // an immediate child, then that will trigger as an "Enter" in future passes.
77+ // We don't do anything else for that case in the "before mutation" phase but we
78+ // still have to mark it as needing to call startViewTransition if nothing else
79+ // updates.
80+ shouldStartViewTransition = true ;
81+ }
82+ }
83+
7084// We can't cancel view transition children until we know that their parent also
7185// don't need to transition.
7286export let viewTransitionCancelableChildren : null | Array <
@@ -119,7 +133,6 @@ function applyViewTransitionToHostInstancesRecursive(
119133 let inViewport = false ;
120134 while ( child !== null ) {
121135 if ( child . tag === HostComponent ) {
122- shouldStartViewTransition = true ;
123136 const instance : Instance = child . stateNode ;
124137 if ( collectMeasurements !== null ) {
125138 const measurement = measureInstance ( instance ) ;
@@ -132,6 +145,7 @@ function applyViewTransitionToHostInstancesRecursive(
132145 inViewport = true ;
133146 }
134147 }
148+ shouldStartViewTransition = true ;
135149 applyViewTransitionName (
136150 instance ,
137151 viewTransitionHostInstanceIdx === 0
0 commit comments