Skip to content

Commit 86f3385

Browse files
committed
Revert "Use highest priority lane to detect interruptions (#21088)"
This reverts commit b4044f8. Instead of LanePriority. I'm removing all uses of LanePriority so I can delete it.
1 parent c670265 commit 86f3385

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

packages/react-reconciler/src/ReactFiberLane.new.js

+5-6
Original file line numberDiff line numberDiff line change
@@ -300,16 +300,15 @@ export function getNextLanes(root: FiberRoot, wipLanes: Lanes): Lanes {
300300
// bother waiting until the root is complete.
301301
(wipLanes & suspendedLanes) === NoLanes
302302
) {
303-
const nextLane = getHighestPriorityLane(nextLanes);
304-
const wipLane = getHighestPriorityLane(wipLanes);
303+
getHighestPriorityLanes(wipLanes);
304+
const wipLanePriority = return_highestLanePriority;
305305
if (
306-
// Tests whether the next lane is equal or lower priority than the wip
307-
// one. This works because the bits decrease in priority as you go left.
308-
nextLane >= wipLane ||
306+
nextLanePriority <= wipLanePriority ||
309307
// Default priority updates should not interrupt transition updates. The
310308
// only difference between default updates and transition updates is that
311309
// default updates do not support refresh transitions.
312-
(nextLane === DefaultLane && (wipLane & TransitionLanes) !== NoLanes)
310+
(nextLanePriority === DefaultLanePriority &&
311+
wipLanePriority === TransitionPriority)
313312
) {
314313
// Keep working on the existing in-progress tree. Do not interrupt.
315314
return wipLanes;

packages/react-reconciler/src/ReactFiberLane.old.js

+5-6
Original file line numberDiff line numberDiff line change
@@ -300,16 +300,15 @@ export function getNextLanes(root: FiberRoot, wipLanes: Lanes): Lanes {
300300
// bother waiting until the root is complete.
301301
(wipLanes & suspendedLanes) === NoLanes
302302
) {
303-
const nextLane = getHighestPriorityLane(nextLanes);
304-
const wipLane = getHighestPriorityLane(wipLanes);
303+
getHighestPriorityLanes(wipLanes);
304+
const wipLanePriority = return_highestLanePriority;
305305
if (
306-
// Tests whether the next lane is equal or lower priority than the wip
307-
// one. This works because the bits decrease in priority as you go left.
308-
nextLane >= wipLane ||
306+
nextLanePriority <= wipLanePriority ||
309307
// Default priority updates should not interrupt transition updates. The
310308
// only difference between default updates and transition updates is that
311309
// default updates do not support refresh transitions.
312-
(nextLane === DefaultLane && (wipLane & TransitionLanes) !== NoLanes)
310+
(nextLanePriority === DefaultLanePriority &&
311+
wipLanePriority === TransitionPriority)
313312
) {
314313
// Keep working on the existing in-progress tree. Do not interrupt.
315314
return wipLanes;

0 commit comments

Comments
 (0)