MCPcopy Create free account
hub / github.com/react/react / isPreambleReady

Function isPreambleReady

packages/react-dom-bindings/src/server/ReactFizzConfigDOM.js:4446–4463  ·  view source on GitHub ↗
(
  renderState: RenderState,
  // This means there are unfinished Suspense boundaries which could contain
  // a preamble. In the case of DOM we constrain valid programs to only having
  // one instance of each singleton so we can determine the preamble is ready
  // as long as we have chunks for each of these tags.
  hasPendingPreambles: boolean,
)

Source from the content-addressed store, hash-verified

4444}
4445
4446export function isPreambleReady(
4447 renderState: RenderState,
4448 // This means there are unfinished Suspense boundaries which could contain
4449 // a preamble. In the case of DOM we constrain valid programs to only having
4450 // one instance of each singleton so we can determine the preamble is ready
4451 // as long as we have chunks for each of these tags.
4452 hasPendingPreambles: boolean,
4453): boolean {
4454 const preamble = renderState.preamble;
4455 return (
4456 // There are no remaining boundaries which might contain a preamble so
4457 // the preamble is as complete as it is going to get
4458 hasPendingPreambles === false ||
4459 // we have a head and body tag. we don't need to wait for any more
4460 // because it would be invalid to render additional copies of these tags
4461 !!(preamble.headChunks && preamble.bodyChunks)
4462 );
4463}
4464
4465function writeBootstrap(
4466 destination: Destination,

Callers 1

preparePreambleFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected