@@ -625,26 +625,7 @@ export function markRootUpdated(root: FiberRoot, updateLane: Lane) {
625
625
// idle updates until after all the regular updates have finished; there's no
626
626
// way it could unblock a transition.
627
627
if ( updateLane !== IdleLane ) {
628
- if ( enableUpdaterTracking ) {
629
- if ( isDevToolsPresent ) {
630
- // transfer pending updaters from pingedLanes to updateLane
631
- const pendingUpdatersLaneMap = root . pendingUpdatersLaneMap ;
632
- const updaters = pendingUpdatersLaneMap [ laneToIndex ( updateLane ) ] ;
633
- let lanes = root . pingedLanes ;
634
- while ( lanes > 0 ) {
635
- const index = laneToIndex ( lanes ) ;
636
- const lane = 1 << index ;
637
-
638
- const pingedUpdaters = pendingUpdatersLaneMap [ index ] ;
639
- pingedUpdaters . forEach ( pingedUpdater => {
640
- updaters . add ( pingedUpdater ) ;
641
- } ) ;
642
- pingedUpdaters . clear ( ) ;
643
-
644
- lanes &= ~ lane ;
645
- }
646
- }
647
- }
628
+ movePendingUpdatersToLane ( root , root . pingedLanes , updateLane ) ;
648
629
649
630
root . suspendedLanes = NoLanes ;
650
631
root . pingedLanes = NoLanes ;
@@ -927,6 +908,35 @@ export function addFiberToLanesMap(
927
908
}
928
909
}
929
910
911
+ function movePendingUpdatersToLane (
912
+ root : FiberRoot ,
913
+ sourceLanes : Lanes ,
914
+ targetLane : Lane ,
915
+ ) {
916
+ if ( ! enableUpdaterTracking ) {
917
+ return ;
918
+ }
919
+ if (!isDevToolsPresent) {
920
+ return ;
921
+ }
922
+ const pendingUpdatersLaneMap = root.pendingUpdatersLaneMap;
923
+ const targetIndex = laneToIndex(targetLane)
924
+ const targetUpdaters = pendingUpdatersLaneMap[targetIndex];
925
+ let lanes = sourceLanes;
926
+ while (lanes > 0 ) {
927
+ const index = laneToIndex ( lanes ) ;
928
+ const lane = 1 << index ;
929
+
930
+ const sourceUpdaters = pendingUpdatersLaneMap [ index ] ;
931
+ sourceUpdaters . forEach ( sourceUpdater => {
932
+ targetUpdaters . add ( sourceUpdater ) ;
933
+ } ) ;
934
+ sourceUpdaters . clear ( ) ;
935
+
936
+ lanes &= ~ lane ;
937
+ }
938
+ }
939
+
930
940
export function movePendingFibersToMemoized ( root : FiberRoot , lanes : Lanes ) {
931
941
if ( ! enableUpdaterTracking ) {
932
942
return ;
0 commit comments