@@ -2809,12 +2809,12 @@ function commitPassiveMountOnFiber(
2809
2809
if ( enableTransitionTracing ) {
2810
2810
// Get the transitions that were initiatized during the render
2811
2811
// 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 ;
2814
2814
// Initial render
2815
2815
if ( committedTransitions !== null ) {
2816
- if ( state . incompleteTransitions === null ) {
2817
- state . incompleteTransitions = incompleteTransitions = new Map ( ) ;
2816
+ if ( incompleteTransitions === null ) {
2817
+ root . incompleteTransitions = incompleteTransitions = new Map ( ) ;
2818
2818
}
2819
2819
2820
2820
committedTransitions . forEach ( transition => {
@@ -2849,7 +2849,7 @@ function commitPassiveMountOnFiber(
2849
2849
incompleteTransitions === null ||
2850
2850
incompleteTransitions . size === 0
2851
2851
) {
2852
- state . incompleteTransitions = null ;
2852
+ root . incompleteTransitions = null ;
2853
2853
}
2854
2854
}
2855
2855
break ;
@@ -2889,22 +2889,19 @@ function commitPassiveMountOnFiber(
2889
2889
if ( enableTransitionTracing ) {
2890
2890
const isFallback = finishedWork . memoizedState ;
2891
2891
const queue = ( finishedWork . updateQueue : any ) ;
2892
- const rootMemoizedState = finishedRoot . current . memoizedState ;
2893
2892
const instance = finishedWork . stateNode ;
2894
2893
2895
2894
if ( queue !== null ) {
2896
2895
if ( isFallback ) {
2897
2896
const transitions = queue . transitions ;
2898
2897
let prevTransitions = instance . transitions ;
2899
- let rootIncompleteTransitions =
2900
- rootMemoizedState . incompleteTransitions ;
2898
+ let rootIncompleteTransitions = finishedRoot . incompleteTransitions ;
2901
2899
2902
2900
// We lazily instantiate transition tracing relevant maps
2903
2901
// and sets in the commit phase as we need to use them. We only
2904
2902
// 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 ( ) ;
2908
2905
}
2909
2906
if ( instance . pendingMarkers === null ) {
2910
2907
instance . pendingMarkers = new Set ( ) ;
@@ -2924,12 +2921,14 @@ function commitPassiveMountOnFiber(
2924
2921
// the queue's marker set. We will iterate through the marker
2925
2922
// set when we toggle state on the suspense boundary and
2926
2923
// 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
+ ) ;
2929
2931
}
2930
- instance . pendingMarkers . add (
2931
- rootIncompleteTransitions . get ( transition ) ,
2932
- ) ;
2933
2932
} ) ;
2934
2933
}
2935
2934
}
0 commit comments