@@ -1732,12 +1732,12 @@ function renderSuspenseListRows(
17321732 const prevRow = task . row ;
17331733 const totalChildren = rows . length ;
17341734
1735+ let previousSuspenseListRow : null | SuspenseListRow = null ;
17351736 if ( task . replay !== null ) {
17361737 // Replay
17371738 // First we need to check if we have any resume slots at this level.
17381739 const resumeSlots = task . replay . slots ;
17391740 if ( resumeSlots !== null && typeof resumeSlots === 'object' ) {
1740- let previousSuspenseListRow : null | SuspenseListRow = null ;
17411741 for ( let n = 0 ; n < totalChildren ; n ++ ) {
17421742 // Since we are going to resume into a slot whose order was already
17431743 // determined by the prerender, we can safely resume it even in reverse
@@ -1763,7 +1763,6 @@ function renderSuspenseListRows(
17631763 }
17641764 }
17651765 } else {
1766- let previousSuspenseListRow : null | SuspenseListRow = null ;
17671766 for ( let n = 0 ; n < totalChildren ; n ++ ) {
17681767 // Since we are going to resume into a slot whose order was already
17691768 // determined by the prerender, we can safely resume it even in reverse
@@ -1787,7 +1786,6 @@ function renderSuspenseListRows(
17871786 task = ( ( task : any ) : RenderTask ) ; // Refined
17881787 if ( revealOrder !== 'backwards' ) {
17891788 // Forwards direction
1790- let previousSuspenseListRow : null | SuspenseListRow = null ;
17911789 for ( let i = 0 ; i < totalChildren ; i ++ ) {
17921790 const node = rows [ i ] ;
17931791 if ( __DEV__ ) {
@@ -1809,7 +1807,6 @@ function renderSuspenseListRows(
18091807 const parentSegment = task . blockedSegment ;
18101808 const childIndex = parentSegment . children . length ;
18111809 const insertionIndex = parentSegment . chunks . length ;
1812- let previousSuspenseListRow : null | SuspenseListRow = null ;
18131810 for ( let i = totalChildren - 1 ; i >= 0 ; i -- ) {
18141811 const node = rows [ i ] ;
18151812 task . row = previousSuspenseListRow = createSuspenseListRow (
@@ -1859,6 +1856,17 @@ function renderSuspenseListRows(
18591856 }
18601857 }
18611858
1859+ if (
1860+ prevRow !== null &&
1861+ previousSuspenseListRow !== null &&
1862+ previousSuspenseListRow . pendingTasks > 0
1863+ ) {
1864+ // If we are part of an outer SuspenseList and our last row is still pending, then that blocks
1865+ // the parent row from completing. We can continue the chain.
1866+ prevRow . pendingTasks ++ ;
1867+ previousSuspenseListRow . next = prevRow ;
1868+ }
1869+
18621870 // Because this context is always set right before rendering every child, we
18631871 // only need to reset it to the previous value at the very end.
18641872 task . treeContext = prevTreeContext ;
0 commit comments