MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / appendAllChildren

Function appendAllChildren

code/one-direction-data-flow/public/app.js:10503–10531  ·  view source on GitHub ↗
(parent, workInProgress)

Source from the content-addressed store, hash-verified

10501 }
10502
10503 function appendAllChildren(parent, workInProgress) {
10504 // We only have the top Fiber that was created but we need recurse down its
10505 // children to find all the terminal nodes.
10506 var node = workInProgress.child;
10507 while (node !== null) {
10508 if (node.tag === HostComponent || node.tag === HostText) {
10509 appendInitialChild(parent, node.stateNode);
10510 } else if (node.tag === HostPortal) {
10511 // If we have a portal child, then we don't want to traverse
10512 // down its children. Instead, we'll get insertions from each child in
10513 // the portal directly.
10514 } else if (node.child !== null) {
10515 node.child['return'] = node;
10516 node = node.child;
10517 continue;
10518 }
10519 if (node === workInProgress) {
10520 return;
10521 }
10522 while (node.sibling === null) {
10523 if (node['return'] === null || node['return'] === workInProgress) {
10524 return;
10525 }
10526 node = node['return'];
10527 }
10528 node.sibling['return'] = node['return'];
10529 node = node.sibling;
10530 }
10531 }
10532
10533 var updateHostContainer = void 0;
10534 var updateHostComponent = void 0;

Callers 2

ReactFiberCompleteWorkFunction · 0.70
completeWorkFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected