@@ -1377,29 +1377,32 @@ function renderSuspenseBoundary(
13771377 // no parent segment so there's nothing to wait on.
13781378 contentRootSegment.parentFlushed = true;
13791379
1380- if (request.trackedPostpones !== null) {
1380+ const trackedPostpones = request.trackedPostpones;
1381+ if (trackedPostpones !== null || defer) {
1382+ // This is a prerender or deferred boundary. In this mode we want to render the fallback synchronously
1383+ // and schedule the content to render later. This is the opposite of what we do during a normal render
1384+ // where we try to skip rendering the fallback if the content itself can render synchronously
1385+
13811386 // Stash the original stack frame.
13821387 const suspenseComponentStack = task . componentStack ;
1383- // This is a prerender. In this mode we want to render the fallback synchronously and schedule
1384- // the content to render later. This is the opposite of what we do during a normal render
1385- // where we try to skip rendering the fallback if the content itself can render synchronously
1386- const trackedPostpones = request . trackedPostpones ;
13871388
13881389 const fallbackKeyPath : KeyNode = [
13891390 keyPath [ 0 ] ,
13901391 'Suspense Fallback' ,
13911392 keyPath [ 2 ] ,
13921393 ] ;
1393- const fallbackReplayNode : ReplayNode = [
1394- fallbackKeyPath [ 1 ] ,
1395- fallbackKeyPath [ 2 ] ,
1396- ( [ ] : Array < ReplayNode > ) ,
1397- null ,
1398- ] ;
1399- trackedPostpones . workingMap . set ( fallbackKeyPath , fallbackReplayNode ) ;
1400- // We are rendering the fallback before the boundary content so we keep track of
1401- // the fallback replay node until we determine if the primary content suspends
1402- newBoundary . trackedFallbackNode = fallbackReplayNode ;
1394+ if ( trackedPostpones !== null ) {
1395+ const fallbackReplayNode : ReplayNode = [
1396+ fallbackKeyPath [ 1 ] ,
1397+ fallbackKeyPath [ 2 ] ,
1398+ ( [ ] : Array < ReplayNode > ) ,
1399+ null ,
1400+ ] ;
1401+ trackedPostpones . workingMap . set ( fallbackKeyPath , fallbackReplayNode ) ;
1402+ // We are rendering the fallback before the boundary content so we keep track of
1403+ // the fallback replay node until we determine if the primary content suspends
1404+ newBoundary . trackedFallbackNode = fallbackReplayNode ;
1405+ }
14031406
14041407 task . blockedSegment = boundarySegment ;
14051408 task . blockedPreamble = newBoundary . fallbackPreamble ;
0 commit comments