@@ -27,6 +27,7 @@ import {
2727 transitionLaneExpirationMs ,
2828 retryLaneExpirationMs ,
2929 disableLegacyMode ,
30+ enableSiblingPrerendering ,
3031} from 'shared/ReactFeatureFlags' ;
3132import { isDevToolsPresent } from './ReactFiberDevToolsHook' ;
3233import { clz32 } from './clz32' ;
@@ -270,11 +271,13 @@ export function getNextLanes(root: FiberRoot, wipLanes: Lanes): Lanes {
270271 if ( nonIdlePingedLanes !== NoLanes ) {
271272 nextLanes = getHighestPriorityLanes ( nonIdlePingedLanes ) ;
272273 } else {
273- // Nothing has been pinged. Check for lanes that need to be prewarmed.
274- if ( ! rootHasPendingCommit ) {
275- const lanesToPrewarm = nonIdlePendingLanes & ~ warmLanes ;
276- if ( lanesToPrewarm !== NoLanes ) {
277- nextLanes = getHighestPriorityLanes ( lanesToPrewarm ) ;
274+ if ( enableSiblingPrerendering ) {
275+ // Nothing has been pinged. Check for lanes that need to be prewarmed.
276+ if ( ! rootHasPendingCommit ) {
277+ const lanesToPrewarm = nonIdlePendingLanes & ~ warmLanes ;
278+ if ( lanesToPrewarm !== NoLanes ) {
279+ nextLanes = getHighestPriorityLanes ( lanesToPrewarm ) ;
280+ }
278281 }
279282 }
280283 }
@@ -294,11 +297,13 @@ export function getNextLanes(root: FiberRoot, wipLanes: Lanes): Lanes {
294297 if ( pingedLanes !== NoLanes ) {
295298 nextLanes = getHighestPriorityLanes ( pingedLanes ) ;
296299 } else {
297- // Nothing has been pinged. Check for lanes that need to be prewarmed.
298- if ( ! rootHasPendingCommit ) {
299- const lanesToPrewarm = pendingLanes & ~ warmLanes ;
300- if ( lanesToPrewarm !== NoLanes ) {
301- nextLanes = getHighestPriorityLanes ( lanesToPrewarm ) ;
300+ if ( enableSiblingPrerendering ) {
301+ // Nothing has been pinged. Check for lanes that need to be prewarmed.
302+ if ( ! rootHasPendingCommit ) {
303+ const lanesToPrewarm = pendingLanes & ~ warmLanes ;
304+ if ( lanesToPrewarm !== NoLanes ) {
305+ nextLanes = getHighestPriorityLanes ( lanesToPrewarm ) ;
306+ }
302307 }
303308 }
304309 }
@@ -765,7 +770,7 @@ export function markRootSuspended(
765770 root . suspendedLanes |= suspendedLanes ;
766771 root . pingedLanes &= ~ suspendedLanes ;
767772
768- if ( ! didSkipSuspendedSiblings ) {
773+ if ( enableSiblingPrerendering && ! didSkipSuspendedSiblings ) {
769774 // Mark these lanes as warm so we know there's nothing else to work on.
770775 root . warmLanes |= suspendedLanes ;
771776 } else {
@@ -876,6 +881,7 @@ export function markRootFinished(
876881 // suspended) instead of the regular mode (i.e. unwind and skip the siblings
877882 // as soon as something suspends to unblock the rest of the update).
878883 if (
884+ enableSiblingPrerendering &&
879885 suspendedRetryLanes !== NoLanes &&
880886 // Note that we only do this if there were no updates since we started
881887 // rendering. This mirrors the logic in markRootUpdated — whenever we
0 commit comments