@@ -1732,12 +1732,12 @@ function renderSuspenseListRows(
1732
1732
const prevRow = task . row ;
1733
1733
const totalChildren = rows . length ;
1734
1734
1735
+ let previousSuspenseListRow : null | SuspenseListRow = null ;
1735
1736
if ( task . replay !== null ) {
1736
1737
// Replay
1737
1738
// First we need to check if we have any resume slots at this level.
1738
1739
const resumeSlots = task . replay . slots ;
1739
1740
if ( resumeSlots !== null && typeof resumeSlots === 'object' ) {
1740
- let previousSuspenseListRow : null | SuspenseListRow = null ;
1741
1741
for ( let n = 0 ; n < totalChildren ; n ++ ) {
1742
1742
// Since we are going to resume into a slot whose order was already
1743
1743
// determined by the prerender, we can safely resume it even in reverse
@@ -1763,7 +1763,6 @@ function renderSuspenseListRows(
1763
1763
}
1764
1764
}
1765
1765
} else {
1766
- let previousSuspenseListRow : null | SuspenseListRow = null ;
1767
1766
for ( let n = 0 ; n < totalChildren ; n ++ ) {
1768
1767
// Since we are going to resume into a slot whose order was already
1769
1768
// determined by the prerender, we can safely resume it even in reverse
@@ -1787,7 +1786,6 @@ function renderSuspenseListRows(
1787
1786
task = ( ( task : any ) : RenderTask ) ; // Refined
1788
1787
if ( revealOrder !== 'backwards' ) {
1789
1788
// Forwards direction
1790
- let previousSuspenseListRow : null | SuspenseListRow = null ;
1791
1789
for ( let i = 0 ; i < totalChildren ; i ++ ) {
1792
1790
const node = rows [ i ] ;
1793
1791
if ( __DEV__ ) {
@@ -1809,7 +1807,6 @@ function renderSuspenseListRows(
1809
1807
const parentSegment = task . blockedSegment ;
1810
1808
const childIndex = parentSegment . children . length ;
1811
1809
const insertionIndex = parentSegment . chunks . length ;
1812
- let previousSuspenseListRow : null | SuspenseListRow = null ;
1813
1810
for ( let i = totalChildren - 1 ; i >= 0 ; i -- ) {
1814
1811
const node = rows [ i ] ;
1815
1812
task . row = previousSuspenseListRow = createSuspenseListRow (
@@ -1859,6 +1856,17 @@ function renderSuspenseListRows(
1859
1856
}
1860
1857
}
1861
1858
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
+
1862
1870
// Because this context is always set right before rendering every child, we
1863
1871
// only need to reset it to the previous value at the very end.
1864
1872
task . treeContext = prevTreeContext ;
0 commit comments