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

Function updateCallComponent

code/event-handlers/public/app.js:9505–9531  ·  view source on GitHub ↗
(current, workInProgress, renderExpirationTime)

Source from the content-addressed store, hash-verified

9503 }
9504
9505 function updateCallComponent(current, workInProgress, renderExpirationTime) {
9506 var nextProps = workInProgress.pendingProps;
9507 if (hasLegacyContextChanged()) {
9508 // Normally we can bail out on props equality but if context has changed
9509 // we don't do the bailout and we have to reuse existing props instead.
9510 } else if (workInProgress.memoizedProps === nextProps) {
9511 nextProps = workInProgress.memoizedProps;
9512 // TODO: When bailing out, we might need to return the stateNode instead
9513 // of the child. To check it for work.
9514 // return bailoutOnAlreadyFinishedWork(current, workInProgress);
9515 }
9516
9517 var nextChildren = nextProps.children;
9518
9519 // The following is a fork of reconcileChildrenAtExpirationTime but using
9520 // stateNode to store the child.
9521 if (current === null) {
9522 workInProgress.stateNode = mountChildFibers(workInProgress, workInProgress.stateNode, nextChildren, renderExpirationTime);
9523 } else {
9524 workInProgress.stateNode = reconcileChildFibers(workInProgress, current.stateNode, nextChildren, renderExpirationTime);
9525 }
9526
9527 memoizeProps(workInProgress, nextProps);
9528 // This doesn't take arbitrary time so we could synchronously just begin
9529 // eagerly do the work of workInProgress.child as an optimization.
9530 return workInProgress.stateNode;
9531 }
9532
9533 function updatePortalComponent(current, workInProgress, renderExpirationTime) {
9534 pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);

Callers 1

beginWorkFunction · 0.70

Calls 2

reconcileChildFibersFunction · 0.70
memoizePropsFunction · 0.70

Tested by

no test coverage detected