MCPcopy
hub / github.com/facebook/react / createSuspenseListRow

Function createSuspenseListRow

packages/react-server/src/ReactFizzServer.js:1890–1909  ·  view source on GitHub ↗
(
  previousRow: null | SuspenseListRow,
)

Source from the content-addressed store, hash-verified

1888}
1889
1890function createSuspenseListRow(
1891 previousRow: null | SuspenseListRow,
1892): SuspenseListRow {
1893 const newRow: SuspenseListRow = {
1894 pendingTasks: 1, // At first the row is blocked on attempting rendering itself.
1895 boundaries: null,
1896 hoistables: createHoistableState(),
1897 inheritedHoistables: null,
1898 together: false,
1899 next: null,
1900 };
1901 if (previousRow !== null && previousRow.pendingTasks > 0) {
1902 // If the previous row is not done yet, we add ourselves to be blocked on it.
1903 // When it finishes, we'll decrement our pending tasks.
1904 newRow.pendingTasks++;
1905 newRow.boundaries = [];
1906 previousRow.next = newRow;
1907 }
1908 return newRow;
1909}
1910
1911function renderSuspenseListRows(
1912 request: Request,

Callers 2

renderSuspenseListRowsFunction · 0.85
renderSuspenseListFunction · 0.85

Calls 1

createHoistableStateFunction · 0.90

Tested by

no test coverage detected