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

Function createPrerenderRequest

packages/react-server/src/ReactFlightServer.js:809–841  ·  view source on GitHub ↗
(
  model: ReactClientValue,
  bundlerConfig: ClientManifest,
  onAllReady: () => void,
  onFatalError: () => void,
  onError: void | ((error: mixed) => ?string),
  identifierPrefix: void | string,
  onPostpone: void | ((reason: string) => void),
  temporaryReferences: void | TemporaryReferenceSet,
  environmentName: void | string | (() => string), // DEV-only
  filterStackFrame: void | ((url: string, functionName: string) => boolean), // DEV-only
  keepDebugAlive: boolean, // DEV-only
)

Source from the content-addressed store, hash-verified

807}
808
809export function createPrerenderRequest(
810 model: ReactClientValue,
811 bundlerConfig: ClientManifest,
812 onAllReady: () => void,
813 onFatalError: () => void,
814 onError: void | ((error: mixed) => ?string),
815 identifierPrefix: void | string,
816 onPostpone: void | ((reason: string) => void),
817 temporaryReferences: void | TemporaryReferenceSet,
818 environmentName: void | string | (() => string), // DEV-only
819 filterStackFrame: void | ((url: string, functionName: string) => boolean), // DEV-only
820 keepDebugAlive: boolean, // DEV-only
821): Request {
822 if (__DEV__) {
823 resetOwnerStackLimit();
824 }
825
826 // $FlowFixMe[invalid-constructor]: the shapes are exact here but Flow doesn't like constructors
827 return new RequestInstance(
828 PRERENDER,
829 model,
830 bundlerConfig,
831 onError,
832 onPostpone,
833 onAllReady,
834 onFatalError,
835 identifierPrefix,
836 temporaryReferences,
837 environmentName,
838 filterStackFrame,
839 keepDebugAlive,
840 );
841}
842
843let currentRequest: null | Request = null;
844

Callers 15

prerenderFunction · 0.90
prerenderFunction · 0.90
prerenderToNodeStreamFunction · 0.90
prerenderFunction · 0.90
prerenderFunction · 0.90
prerenderFunction · 0.90
prerenderToNodeStreamFunction · 0.90
prerenderFunction · 0.90
prerenderToNodeStreamFunction · 0.90
prerenderFunction · 0.90
prerenderFunction · 0.90
prerenderFunction · 0.90

Calls 1

resetOwnerStackLimitFunction · 0.90

Tested by

no test coverage detected