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

Function tryToResolveTogetherRow

packages/react-server/src/ReactFizzServer.js:1862–1888  ·  view source on GitHub ↗
(
  request: Request,
  togetherRow: SuspenseListRow,
)

Source from the content-addressed store, hash-verified

1860}
1861
1862function tryToResolveTogetherRow(
1863 request: Request,
1864 togetherRow: SuspenseListRow,
1865): void {
1866 // If we have a "together" row and all the pendingTasks are really the boundaries themselves,
1867 // and we won't outline any of them then we can unblock this row early so that we can inline
1868 // all the boundaries at once.
1869 const boundaries = togetherRow.boundaries;
1870 if (boundaries === null || togetherRow.pendingTasks !== boundaries.length) {
1871 return;
1872 }
1873 let allCompleteAndInlinable = true;
1874 for (let i = 0; i < boundaries.length; i++) {
1875 const rowBoundary = boundaries[i];
1876 if (
1877 rowBoundary.pendingTasks !== 1 ||
1878 rowBoundary.parentFlushed ||
1879 isEligibleForOutlining(request, rowBoundary)
1880 ) {
1881 allCompleteAndInlinable = false;
1882 break;
1883 }
1884 }
1885 if (allCompleteAndInlinable) {
1886 unblockSuspenseListRow(request, togetherRow, togetherRow.hoistables);
1887 }
1888}
1889
1890function createSuspenseListRow(
1891 previousRow: null | SuspenseListRow,

Callers 2

renderSuspenseBoundaryFunction · 0.85
finishedTaskFunction · 0.85

Calls 2

isEligibleForOutliningFunction · 0.85
unblockSuspenseListRowFunction · 0.85

Tested by

no test coverage detected