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

Function beginWork

code/communication/public/app.js:10533–10576  ·  view source on GitHub ↗
(current, workInProgress, renderExpirationTime)

Source from the content-addressed store, hash-verified

10531 }
10532
10533 function beginWork(current, workInProgress, renderExpirationTime) {
10534 if (workInProgress.expirationTime === NoWork || workInProgress.expirationTime > renderExpirationTime) {
10535 return bailoutOnLowPriority(current, workInProgress);
10536 }
10537
10538 switch (workInProgress.tag) {
10539 case IndeterminateComponent:
10540 return mountIndeterminateComponent(current, workInProgress, renderExpirationTime);
10541 case FunctionalComponent:
10542 return updateFunctionalComponent(current, workInProgress);
10543 case ClassComponent:
10544 return updateClassComponent(current, workInProgress, renderExpirationTime);
10545 case HostRoot:
10546 return updateHostRoot(current, workInProgress, renderExpirationTime);
10547 case HostComponent:
10548 return updateHostComponent(current, workInProgress, renderExpirationTime);
10549 case HostText:
10550 return updateHostText(current, workInProgress);
10551 case CallHandlerPhase:
10552 // This is a restart. Reset the tag to the initial phase.
10553 workInProgress.tag = CallComponent;
10554 // Intentionally fall through since this is now the same.
10555 case CallComponent:
10556 return updateCallComponent(current, workInProgress, renderExpirationTime);
10557 case ReturnComponent:
10558 // A return component is just a placeholder, we can just run through the
10559 // next one immediately.
10560 return null;
10561 case HostPortal:
10562 return updatePortalComponent(current, workInProgress, renderExpirationTime);
10563 case ForwardRef:
10564 return updateForwardRef(current, workInProgress);
10565 case Fragment:
10566 return updateFragment(current, workInProgress);
10567 case Mode:
10568 return updateMode(current, workInProgress);
10569 case ContextProvider:
10570 return updateContextProvider(current, workInProgress, renderExpirationTime);
10571 case ContextConsumer:
10572 return updateContextConsumer(current, workInProgress, renderExpirationTime);
10573 default:
10574 invariant(false, 'Unknown unit of work tag. This error is likely caused by a bug in React. Please file an issue.');
10575 }
10576 }
10577
10578 return {
10579 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