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

Function renderNodeDestructive

packages/react-server/src/ReactFizzServer.js:3290–3318  ·  view source on GitHub ↗
(
  request: Request,
  task: Task,
  node: ReactNodeList,
  childIndex: number,
)

Source from the content-addressed store, hash-verified

3288// This function by it self renders a node and consumes the task by mutating it
3289// to update the current execution state.
3290function renderNodeDestructive(
3291 request: Request,
3292 task: Task,
3293 node: ReactNodeList,
3294 childIndex: number,
3295): void {
3296 if (task.replay !== null && typeof task.replay.slots === 'number') {
3297 // TODO: Figure out a cheaper place than this hot path to do this check.
3298 const resumeSegmentID = task.replay.slots;
3299 resumeNode(request, task, resumeSegmentID, node, childIndex);
3300 return;
3301 }
3302 // Stash the node we're working on. We'll pick up from this task in case
3303 // something suspends.
3304 task.node = node;
3305 task.childIndex = childIndex;
3306
3307 const previousComponentStack = task.componentStack;
3308 const previousDebugTask = __DEV__ ? task.debugTask : null;
3309
3310 pushComponentStack(task);
3311
3312 retryNode(request, task);
3313
3314 task.componentStack = previousComponentStack;
3315 if (__DEV__) {
3316 task.debugTask = previousDebugTask;
3317 }
3318}
3319
3320function retryNode(request: Request, task: Task): void {
3321 const node = task.node;

Callers 9

renderSuspenseListFunction · 0.85
finishClassComponentFunction · 0.85
finishFunctionComponentFunction · 0.85
renderContextConsumerFunction · 0.85
renderContextProviderFunction · 0.85
renderViewTransitionFunction · 0.85
renderElementFunction · 0.85
retryNodeFunction · 0.85
renderNodeFunction · 0.85

Calls 3

resumeNodeFunction · 0.85
pushComponentStackFunction · 0.85
retryNodeFunction · 0.85

Tested by

no test coverage detected