@@ -2809,12 +2809,12 @@ function commitPassiveMountOnFiber(
28092809 if ( enableTransitionTracing ) {
28102810 // Get the transitions that were initiatized during the render
28112811 // and add a start transition callback for each of them
2812- const state = finishedWork . memoizedState ;
2813- let incompleteTransitions = state . incompleteTransitions ;
2812+ const root = finishedWork . stateNode ;
2813+ let incompleteTransitions = root . incompleteTransitions ;
28142814 // Initial render
28152815 if ( committedTransitions !== null ) {
2816- if ( state . incompleteTransitions === null ) {
2817- state . incompleteTransitions = incompleteTransitions = new Map ( ) ;
2816+ if ( incompleteTransitions === null ) {
2817+ root . incompleteTransitions = incompleteTransitions = new Map ( ) ;
28182818 }
28192819
28202820 committedTransitions . forEach ( transition => {
@@ -2849,7 +2849,7 @@ function commitPassiveMountOnFiber(
28492849 incompleteTransitions === null ||
28502850 incompleteTransitions . size === 0
28512851 ) {
2852- state . incompleteTransitions = null ;
2852+ root . incompleteTransitions = null ;
28532853 }
28542854 }
28552855 break ;
@@ -2889,22 +2889,19 @@ function commitPassiveMountOnFiber(
28892889 if ( enableTransitionTracing ) {
28902890 const isFallback = finishedWork . memoizedState ;
28912891 const queue = ( finishedWork . updateQueue : any ) ;
2892- const rootMemoizedState = finishedRoot . current . memoizedState ;
28932892 const instance = finishedWork . stateNode ;
28942893
28952894 if ( queue !== null ) {
28962895 if ( isFallback ) {
28972896 const transitions = queue . transitions ;
28982897 let prevTransitions = instance . transitions ;
2899- let rootIncompleteTransitions =
2900- rootMemoizedState . incompleteTransitions ;
2898+ let rootIncompleteTransitions = finishedRoot . incompleteTransitions ;
29012899
29022900 // We lazily instantiate transition tracing relevant maps
29032901 // and sets in the commit phase as we need to use them. We only
29042902 // instantiate them in the fallback phase on an as needed basis
2905- if ( rootMemoizedState . incompleteTransitions === null ) {
2906- // TODO(luna): Move this to the fiber root
2907- rootMemoizedState . incompleteTransitions = rootIncompleteTransitions = new Map ( ) ;
2903+ if ( rootIncompleteTransitions === null ) {
2904+ finishedRoot . incompleteTransitions = rootIncompleteTransitions = new Map ( ) ;
29082905 }
29092906 if ( instance . pendingMarkers === null ) {
29102907 instance . pendingMarkers = new Set ( ) ;
@@ -2924,12 +2921,14 @@ function commitPassiveMountOnFiber(
29242921 // the queue's marker set. We will iterate through the marker
29252922 // set when we toggle state on the suspense boundary and
29262923 // add or remove the pending suspense boundaries as needed.
2927- if ( ! rootIncompleteTransitions . has ( transition ) ) {
2928- rootIncompleteTransitions . set ( transition , new Map ( ) ) ;
2924+ if ( rootIncompleteTransitions !== null ) {
2925+ if ( ! rootIncompleteTransitions . has ( transition ) ) {
2926+ rootIncompleteTransitions . set ( transition , new Map ( ) ) ;
2927+ }
2928+ instance . pendingMarkers . add (
2929+ rootIncompleteTransitions . get ( transition ) ,
2930+ ) ;
29292931 }
2930- instance . pendingMarkers . add (
2931- rootIncompleteTransitions . get ( transition ) ,
2932- ) ;
29332932 } ) ;
29342933 }
29352934 }
0 commit comments