@@ -38,7 +38,6 @@ import {
38
38
enableCache ,
39
39
enableTransitionTracing ,
40
40
useModernStrictMode ,
41
- revertRemovalOfSiblingPrerendering ,
42
41
disableLegacyContext ,
43
42
} from 'shared/ReactFeatureFlags' ;
44
43
import ReactSharedInternals from 'shared/ReactSharedInternals' ;
@@ -2441,28 +2440,14 @@ function completeUnitOfWork(unitOfWork: Fiber): void {
2441
2440
// sibling. If there are no more siblings, return to the parent fiber.
2442
2441
let completedWork : Fiber = unitOfWork ;
2443
2442
do {
2444
- if ( revertRemovalOfSiblingPrerendering ) {
2443
+ if ( __DEV__ ) {
2445
2444
if ( ( completedWork . flags & Incomplete ) !== NoFlags ) {
2446
- // This fiber did not complete, because one of its children did not
2447
- // complete. Switch to unwinding the stack instead of completing it.
2448
- //
2449
- // The reason "unwind" and "complete" is interleaved is because when
2450
- // something suspends, we continue rendering the siblings even though
2451
- // they will be replaced by a fallback.
2452
- // TODO: Disable sibling prerendering, then remove this branch.
2453
- unwindUnitOfWork ( completedWork ) ;
2454
- return ;
2455
- }
2456
- } else {
2457
- if ( __DEV__ ) {
2458
- if ( ( completedWork . flags & Incomplete ) !== NoFlags ) {
2459
- // NOTE: If we re-enable sibling prerendering in some cases, this branch
2460
- // is where we would switch to the unwinding path.
2461
- console . error (
2462
- 'Internal React error: Expected this fiber to be complete, but ' +
2463
- "it isn't. It should have been unwound. This is a bug in React." ,
2464
- ) ;
2465
- }
2445
+ // NOTE: If we re-enable sibling prerendering in some cases, this branch
2446
+ // is where we would switch to the unwinding path.
2447
+ console . error (
2448
+ 'Internal React error: Expected this fiber to be complete, but ' +
2449
+ "it isn't. It should have been unwound. This is a bug in React." ,
2450
+ ) ;
2466
2451
}
2467
2452
}
2468
2453
@@ -2566,24 +2551,9 @@ function unwindUnitOfWork(unitOfWork: Fiber): void {
2566
2551
returnFiber . deletions = null ;
2567
2552
}
2568
2553
2569
- if ( revertRemovalOfSiblingPrerendering ) {
2570
- // If there are siblings, work on them now even though they're going to be
2571
- // replaced by a fallback. We're "prerendering" them. Historically our
2572
- // rationale for this behavior has been to initiate any lazy data requests
2573
- // in the siblings, and also to warm up the CPU cache.
2574
- // TODO: Don't prerender siblings. With `use`, we suspend the work loop
2575
- // until the data has resolved, anyway.
2576
- const siblingFiber = incompleteWork . sibling ;
2577
- if ( siblingFiber !== null ) {
2578
- // This branch will return us to the normal work loop.
2579
- workInProgress = siblingFiber ;
2580
- return ;
2581
- }
2582
- } else {
2583
- // NOTE: If we re-enable sibling prerendering in some cases, this branch
2584
- // is where we would switch to the normal completion path: check if a
2585
- // sibling exists, and if so, begin work on it.
2586
- }
2554
+ // NOTE: If we re-enable sibling prerendering in some cases, here we
2555
+ // would switch to the normal completion path: check if a sibling
2556
+ // exists, and if so, begin work on it.
2587
2557
2588
2558
// Otherwise, return to the parent
2589
2559
// $FlowFixMe[incompatible-type] we bail out when we get a null
0 commit comments