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

Function appendAllChildrenToContainer

code/communication/public/app.js:10732–10760  ·  view source on GitHub ↗
(containerChildSet, workInProgress)

Source from the content-addressed store, hash-verified

10730 // An unfortunate fork of appendAllChildren because we have two different parent types.
10731
10732 var appendAllChildrenToContainer = function (containerChildSet, workInProgress) {
10733 // We only have the top Fiber that was created but we need recurse down its
10734 // children to find all the terminal nodes.
10735 var node = workInProgress.child;
10736 while (node !== null) {
10737 if (node.tag === HostComponent || node.tag === HostText) {
10738 appendChildToContainerChildSet(containerChildSet, node.stateNode);
10739 } else if (node.tag === HostPortal) {
10740 // If we have a portal child, then we don't want to traverse
10741 // down its children. Instead, we'll get insertions from each child in
10742 // the portal directly.
10743 } else if (node.child !== null) {
10744 node.child['return'] = node;
10745 node = node.child;
10746 continue;
10747 }
10748 if (node === workInProgress) {
10749 return;
10750 }
10751 while (node.sibling === null) {
10752 if (node['return'] === null || node['return'] === workInProgress) {
10753 return;
10754 }
10755 node = node['return'];
10756 }
10757 node.sibling['return'] = node['return'];
10758 node = node.sibling;
10759 }
10760 };
10761 updateHostContainer = function (workInProgress) {
10762 var portalOrRoot = workInProgress.stateNode;
10763 var childrenUnchanged = workInProgress.firstEffect === null;

Callers 1

ReactFiberCompleteWorkFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected