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

Function isEligibleForOutlining

packages/react-server/src/ReactFizzServer.js:457–471  ·  view source on GitHub ↗
(
  request: Request,
  boundary: SuspenseBoundary,
)

Source from the content-addressed store, hash-verified

455}
456
457function isEligibleForOutlining(
458 request: Request,
459 boundary: SuspenseBoundary,
460): boolean {
461 // For very small boundaries, don't bother producing a fallback for outlining.
462 // The larger this limit is, the more we can save on preparing fallbacks in case we end up
463 // outlining.
464 return (
465 (boundary.byteSize > 500 || hasSuspenseyContent(boundary.contentState)) &&
466 // For boundaries that can possibly contribute to the preamble we don't want to outline
467 // them regardless of their size since the fallbacks should only be emitted if we've
468 // errored the boundary.
469 boundary.contentPreamble === null
470 );
471}
472
473function defaultErrorHandler(error: mixed) {
474 if (

Callers 5

renderSuspenseBoundaryFunction · 0.85
tryToResolveTogetherRowFunction · 0.85
finishedTaskFunction · 0.85
flushSegmentFunction · 0.85
flushCompletedBoundaryFunction · 0.85

Calls 1

hasSuspenseyContentFunction · 0.90

Tested by

no test coverage detected