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

Function appendAllChildren

code/composition/public/app.js:10768–10796  ·  view source on GitHub ↗
(parent, workInProgress)

Source from the content-addressed store, hash-verified

10766 }
10767
10768 function appendAllChildren(parent, workInProgress) {
10769 // We only have the top Fiber that was created but we need recurse down its
10770 // children to find all the terminal nodes.
10771 var node = workInProgress.child;
10772 while (node !== null) {
10773 if (node.tag === HostComponent || node.tag === HostText) {
10774 appendInitialChild(parent, node.stateNode);
10775 } else if (node.tag === HostPortal) {
10776 // If we have a portal child, then we don't want to traverse
10777 // down its children. Instead, we'll get insertions from each child in
10778 // the portal directly.
10779 } else if (node.child !== null) {
10780 node.child['return'] = node;
10781 node = node.child;
10782 continue;
10783 }
10784 if (node === workInProgress) {
10785 return;
10786 }
10787 while (node.sibling === null) {
10788 if (node['return'] === null || node['return'] === workInProgress) {
10789 return;
10790 }
10791 node = node['return'];
10792 }
10793 node.sibling['return'] = node['return'];
10794 node = node.sibling;
10795 }
10796 }
10797
10798 var updateHostContainer = void 0;
10799 var updateHostComponent = void 0;

Callers 2

ReactFiberCompleteWorkFunction · 0.70
completeWorkFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected