649
? mergeLanes(prevState.baseLanes, renderLanes)
650
: renderLanes;
651
652
+ let remainingChildLanes;
653
if (current !== null) {
654
// Reset to the current children
655
let currentChild = (workInProgress.child = current.child);
667
currentChild = currentChild.sibling;
668
}
669
const lanesWeJustAttempted = nextBaseLanes;
669
- const remainingChildLanes = removeLanes(
670
+ remainingChildLanes = removeLanes(
671
currentChildLanes,
672
lanesWeJustAttempted,
673
);
673
- workInProgress.childLanes = remainingChildLanes;
674
} else {
675
- workInProgress.childLanes = NoLanes;
675
+ remainingChildLanes = NoLanes;
676
workInProgress.child = null;
677
}
678
681
workInProgress,
682
nextBaseLanes,
683
renderLanes,
684
+ remainingChildLanes,
685
);
686
}
687
708
// and resume this tree later.
709
710
// Schedule this fiber to re-render at Offscreen priority
710
- workInProgress.lanes = workInProgress.childLanes =
711
- laneToLanes(OffscreenLane);
711
+
712
+ const remainingChildLanes = (workInProgress.lanes =
713
+ laneToLanes(OffscreenLane));
714
715
// Include the base lanes from the last render
716
const nextBaseLanes =
723
workInProgress,
724
nextBaseLanes,
725
renderLanes,
726
+ remainingChildLanes,
727
);
728
} else {
729
// This is the second render. The surrounding visible content has already
829
workInProgress: Fiber,
830
nextBaseLanes: Lanes,
831
renderLanes: Lanes,
832
+ remainingChildLanes: Lanes,
833
) {
834
const nextState: OffscreenState = {
835
baseLanes: nextBaseLanes,
860
);
861
}
862
863
+ // We override the remaining child lanes to be the subset that we computed
864
+ // on the outside. We need to do this after propagating the context
865
+ // because propagateParentContextChangesToDeferredTree may schedule
866
+ // work which bubbles all the way up to the root and updates our child lanes.
867
+ // We want to dismiss that since we're not going to work on it yet.
868
+ workInProgress.childLanes = remainingChildLanes;
869
+
870
return null;
871
}
872