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

Function moveCallToHandlerPhase

code/styling/public/app.js:10604–10628  ·  view source on GitHub ↗
(current, workInProgress, renderExpirationTime)

Source from the content-addressed store, hash-verified

10602 }
10603
10604 function moveCallToHandlerPhase(current, workInProgress, renderExpirationTime) {
10605 var props = workInProgress.memoizedProps;
10606 !props ? invariant(false, 'Should be resolved by now. This error is likely caused by a bug in React. Please file an issue.') : void 0;
10607
10608 // First step of the call has completed. Now we need to do the second.
10609 // TODO: It would be nice to have a multi stage call represented by a
10610 // single component, or at least tail call optimize nested ones. Currently
10611 // that requires additional fields that we don't want to add to the fiber.
10612 // So this requires nested handlers.
10613 // Note: This doesn't mutate the alternate node. I don't think it needs to
10614 // since this stage is reset for every pass.
10615 workInProgress.tag = CallHandlerPhase;
10616
10617 // Build up the returns.
10618 // TODO: Compare this to a generator or opaque helpers like Children.
10619 var returns = [];
10620 appendAllReturns(returns, workInProgress);
10621 var fn = props.handler;
10622 var childProps = props.props;
10623 var nextChildren = fn(childProps, returns);
10624
10625 var currentFirstChild = current !== null ? current.child : null;
10626 workInProgress.child = reconcileChildFibers(workInProgress, currentFirstChild, nextChildren, renderExpirationTime);
10627 return workInProgress.child;
10628 }
10629
10630 function appendAllChildren(parent, workInProgress) {
10631 // We only have the top Fiber that was created but we need recurse down its

Callers 1

completeWorkFunction · 0.70

Calls 3

invariantFunction · 0.70
appendAllReturnsFunction · 0.70
reconcileChildFibersFunction · 0.70

Tested by

no test coverage detected