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

Function appendAllReturns

code/styling/public/app.js:10578–10602  ·  view source on GitHub ↗
(returns, workInProgress)

Source from the content-addressed store, hash-verified

10576 }
10577
10578 function appendAllReturns(returns, workInProgress) {
10579 var node = workInProgress.stateNode;
10580 if (node) {
10581 node['return'] = workInProgress;
10582 }
10583 while (node !== null) {
10584 if (node.tag === HostComponent || node.tag === HostText || node.tag === HostPortal) {
10585 invariant(false, 'A call cannot have host component children.');
10586 } else if (node.tag === ReturnComponent) {
10587 returns.push(node.pendingProps.value);
10588 } else if (node.child !== null) {
10589 node.child['return'] = node;
10590 node = node.child;
10591 continue;
10592 }
10593 while (node.sibling === null) {
10594 if (node['return'] === null || node['return'] === workInProgress) {
10595 return;
10596 }
10597 node = node['return'];
10598 }
10599 node.sibling['return'] = node['return'];
10600 node = node.sibling;
10601 }
10602 }
10603
10604 function moveCallToHandlerPhase(current, workInProgress, renderExpirationTime) {
10605 var props = workInProgress.memoizedProps;

Callers 1

moveCallToHandlerPhaseFunction · 0.70

Calls 1

invariantFunction · 0.70

Tested by

no test coverage detected