diff --git a/packages/react-reconciler/src/ReactFiberLane.new.js b/packages/react-reconciler/src/ReactFiberLane.new.js index cdf5543c36e6..5a71b4ce489e 100644 --- a/packages/react-reconciler/src/ReactFiberLane.new.js +++ b/packages/react-reconciler/src/ReactFiberLane.new.js @@ -301,15 +301,16 @@ export function getNextLanes(root: FiberRoot, wipLanes: Lanes): Lanes { // bother waiting until the root is complete. (wipLanes & suspendedLanes) === NoLanes ) { - getHighestPriorityLanes(wipLanes); - const wipLanePriority = return_highestLanePriority; + const nextLane = getHighestPriorityLane(nextLanes); + const wipLane = getHighestPriorityLane(wipLanes); if ( - nextLanePriority <= wipLanePriority || + // Tests whether the next lane is equal or lower priority than the wip + // one. This works because the bits decrease in priority as you go left. + nextLane >= wipLane || // Default priority updates should not interrupt transition updates. The // only difference between default updates and transition updates is that // default updates do not support refresh transitions. - (nextLanePriority === DefaultLanePriority && - wipLanePriority === TransitionPriority) + (nextLane === DefaultLane && (wipLane & TransitionLanes) !== NoLanes) ) { // Keep working on the existing in-progress tree. Do not interrupt. return wipLanes; diff --git a/packages/react-reconciler/src/ReactFiberLane.old.js b/packages/react-reconciler/src/ReactFiberLane.old.js index 6ab7163cbb92..d3443dbe24d0 100644 --- a/packages/react-reconciler/src/ReactFiberLane.old.js +++ b/packages/react-reconciler/src/ReactFiberLane.old.js @@ -301,15 +301,16 @@ export function getNextLanes(root: FiberRoot, wipLanes: Lanes): Lanes { // bother waiting until the root is complete. (wipLanes & suspendedLanes) === NoLanes ) { - getHighestPriorityLanes(wipLanes); - const wipLanePriority = return_highestLanePriority; + const nextLane = getHighestPriorityLane(nextLanes); + const wipLane = getHighestPriorityLane(wipLanes); if ( - nextLanePriority <= wipLanePriority || + // Tests whether the next lane is equal or lower priority than the wip + // one. This works because the bits decrease in priority as you go left. + nextLane >= wipLane || // Default priority updates should not interrupt transition updates. The // only difference between default updates and transition updates is that // default updates do not support refresh transitions. - (nextLanePriority === DefaultLanePriority && - wipLanePriority === TransitionPriority) + (nextLane === DefaultLane && (wipLane & TransitionLanes) !== NoLanes) ) { // Keep working on the existing in-progress tree. Do not interrupt. return wipLanes;