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

Function appendAllChildrenToContainer

code/redux/public/app.js:10948–10976  ·  view source on GitHub ↗
(containerChildSet, workInProgress)

Source from the content-addressed store, hash-verified

10946 // An unfortunate fork of appendAllChildren because we have two different parent types.
10947
10948 var appendAllChildrenToContainer = function (containerChildSet, workInProgress) {
10949 // We only have the top Fiber that was created but we need recurse down its
10950 // children to find all the terminal nodes.
10951 var node = workInProgress.child;
10952 while (node !== null) {
10953 if (node.tag === HostComponent || node.tag === HostText) {
10954 appendChildToContainerChildSet(containerChildSet, node.stateNode);
10955 } else if (node.tag === HostPortal) {
10956 // If we have a portal child, then we don't want to traverse
10957 // down its children. Instead, we'll get insertions from each child in
10958 // the portal directly.
10959 } else if (node.child !== null) {
10960 node.child['return'] = node;
10961 node = node.child;
10962 continue;
10963 }
10964 if (node === workInProgress) {
10965 return;
10966 }
10967 while (node.sibling === null) {
10968 if (node['return'] === null || node['return'] === workInProgress) {
10969 return;
10970 }
10971 node = node['return'];
10972 }
10973 node.sibling['return'] = node['return'];
10974 node = node.sibling;
10975 }
10976 };
10977 updateHostContainer = function (workInProgress) {
10978 var portalOrRoot = workInProgress.stateNode;
10979 var childrenUnchanged = workInProgress.firstEffect === null;

Callers 1

ReactFiberCompleteWorkFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected