@@ -38,7 +38,6 @@ import {
3838 enableCache ,
3939 enableTransitionTracing ,
4040 useModernStrictMode ,
41- revertRemovalOfSiblingPrerendering ,
4241 disableLegacyContext ,
4342} from 'shared/ReactFeatureFlags' ;
4443import ReactSharedInternals from 'shared/ReactSharedInternals' ;
@@ -2535,28 +2534,14 @@ function completeUnitOfWork(unitOfWork: Fiber): void {
25352534 // sibling. If there are no more siblings, return to the parent fiber.
25362535 let completedWork : Fiber = unitOfWork ;
25372536 do {
2538- if ( revertRemovalOfSiblingPrerendering ) {
2537+ if ( __DEV__ ) {
25392538 if ( ( completedWork . flags & Incomplete ) !== NoFlags ) {
2540- // This fiber did not complete, because one of its children did not
2541- // complete. Switch to unwinding the stack instead of completing it.
2542- //
2543- // The reason "unwind" and "complete" is interleaved is because when
2544- // something suspends, we continue rendering the siblings even though
2545- // they will be replaced by a fallback.
2546- // TODO: Disable sibling prerendering, then remove this branch.
2547- unwindUnitOfWork ( completedWork ) ;
2548- return ;
2549- }
2550- } else {
2551- if ( __DEV__ ) {
2552- if ( ( completedWork . flags & Incomplete ) !== NoFlags ) {
2553- // NOTE: If we re-enable sibling prerendering in some cases, this branch
2554- // is where we would switch to the unwinding path.
2555- console . error (
2556- 'Internal React error: Expected this fiber to be complete, but ' +
2557- "it isn't. It should have been unwound. This is a bug in React." ,
2558- ) ;
2559- }
2539+ // NOTE: If we re-enable sibling prerendering in some cases, this branch
2540+ // is where we would switch to the unwinding path.
2541+ console . error (
2542+ 'Internal React error: Expected this fiber to be complete, but ' +
2543+ "it isn't. It should have been unwound. This is a bug in React." ,
2544+ ) ;
25602545 }
25612546 }
25622547
@@ -2660,25 +2645,6 @@ function unwindUnitOfWork(unitOfWork: Fiber): void {
26602645 returnFiber . deletions = null ;
26612646 }
26622647
2663- if ( revertRemovalOfSiblingPrerendering ) {
2664- // If there are siblings, work on them now even though they're going to be
2665- // replaced by a fallback. We're "prerendering" them. Historically our
2666- // rationale for this behavior has been to initiate any lazy data requests
2667- // in the siblings, and also to warm up the CPU cache.
2668- // TODO: Don't prerender siblings. With `use`, we suspend the work loop
2669- // until the data has resolved, anyway.
2670- const siblingFiber = incompleteWork . sibling ;
2671- if ( siblingFiber !== null ) {
2672- // This branch will return us to the normal work loop.
2673- workInProgress = siblingFiber ;
2674- return ;
2675- }
2676- } else {
2677- // NOTE: If we re-enable sibling prerendering in some cases, this branch
2678- // is where we would switch to the normal completion path: check if a
2679- // sibling exists, and if so, begin work on it.
2680- }
2681-
26822648 // Otherwise, return to the parent
26832649 // $FlowFixMe[incompatible-type] we bail out when we get a null
26842650 incompleteWork = returnFiber ;
0 commit comments