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

Function outlineHaltedTask

packages/react-server/src/ReactFlightServer.js:2084–2100  ·  view source on GitHub ↗
(
  request: Request,
  task: Task,
  allowLazy: boolean,
)

Source from the content-addressed store, hash-verified

2082}
2083
2084function outlineHaltedTask(
2085 request: Request,
2086 task: Task,
2087 allowLazy: boolean,
2088): ReactJSONValue {
2089 // In the future if we track task state for resuming we'll maybe need to
2090 // construnct an actual task here but since we're never going to retry it
2091 // we just claim the id and serialize it according to the proper convention
2092 const taskId = request.nextChunkId++;
2093 if (allowLazy) {
2094 // We're halting in a position that can handle a lazy reference
2095 return serializeLazyID(taskId);
2096 } else {
2097 // We're halting in a position that needs a value reference
2098 return serializeByValueID(taskId);
2099 }
2100}
2101
2102function renderElement(
2103 request: Request,

Callers 1

renderModelFunction · 0.85

Calls 2

serializeLazyIDFunction · 0.85
serializeByValueIDFunction · 0.70

Tested by

no test coverage detected