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

Function beginWork

code/higher-order-components/public/app.js:10492–10535  ·  view source on GitHub ↗
(current, workInProgress, renderExpirationTime)

Source from the content-addressed store, hash-verified

10490 }
10491
10492 function beginWork(current, workInProgress, renderExpirationTime) {
10493 if (workInProgress.expirationTime === NoWork || workInProgress.expirationTime > renderExpirationTime) {
10494 return bailoutOnLowPriority(current, workInProgress);
10495 }
10496
10497 switch (workInProgress.tag) {
10498 case IndeterminateComponent:
10499 return mountIndeterminateComponent(current, workInProgress, renderExpirationTime);
10500 case FunctionalComponent:
10501 return updateFunctionalComponent(current, workInProgress);
10502 case ClassComponent:
10503 return updateClassComponent(current, workInProgress, renderExpirationTime);
10504 case HostRoot:
10505 return updateHostRoot(current, workInProgress, renderExpirationTime);
10506 case HostComponent:
10507 return updateHostComponent(current, workInProgress, renderExpirationTime);
10508 case HostText:
10509 return updateHostText(current, workInProgress);
10510 case CallHandlerPhase:
10511 // This is a restart. Reset the tag to the initial phase.
10512 workInProgress.tag = CallComponent;
10513 // Intentionally fall through since this is now the same.
10514 case CallComponent:
10515 return updateCallComponent(current, workInProgress, renderExpirationTime);
10516 case ReturnComponent:
10517 // A return component is just a placeholder, we can just run through the
10518 // next one immediately.
10519 return null;
10520 case HostPortal:
10521 return updatePortalComponent(current, workInProgress, renderExpirationTime);
10522 case ForwardRef:
10523 return updateForwardRef(current, workInProgress);
10524 case Fragment:
10525 return updateFragment(current, workInProgress);
10526 case Mode:
10527 return updateMode(current, workInProgress);
10528 case ContextProvider:
10529 return updateContextProvider(current, workInProgress, renderExpirationTime);
10530 case ContextConsumer:
10531 return updateContextConsumer(current, workInProgress, renderExpirationTime);
10532 default:
10533 invariant(false, 'Unknown unit of work tag. This error is likely caused by a bug in React. Please file an issue.');
10534 }
10535 }
10536
10537 return {
10538 beginWork: beginWork

Callers 1

performUnitOfWorkFunction · 0.70

Calls 15

bailoutOnLowPriorityFunction · 0.70
updateClassComponentFunction · 0.70
updateHostRootFunction · 0.70
updateHostComponentFunction · 0.70
updateHostTextFunction · 0.70
updateCallComponentFunction · 0.70
updatePortalComponentFunction · 0.70
updateForwardRefFunction · 0.70
updateFragmentFunction · 0.70
updateModeFunction · 0.70

Tested by

no test coverage detected