MCPcopy Index your code
hub / github.com/krasimir/react-in-patterns / beginWork

Function beginWork

code/composition/public/app.js:10636–10679  ·  view source on GitHub ↗
(current, workInProgress, renderExpirationTime)

Source from the content-addressed store, hash-verified

10634 }
10635
10636 function beginWork(current, workInProgress, renderExpirationTime) {
10637 if (workInProgress.expirationTime === NoWork || workInProgress.expirationTime > renderExpirationTime) {
10638 return bailoutOnLowPriority(current, workInProgress);
10639 }
10640
10641 switch (workInProgress.tag) {
10642 case IndeterminateComponent:
10643 return mountIndeterminateComponent(current, workInProgress, renderExpirationTime);
10644 case FunctionalComponent:
10645 return updateFunctionalComponent(current, workInProgress);
10646 case ClassComponent:
10647 return updateClassComponent(current, workInProgress, renderExpirationTime);
10648 case HostRoot:
10649 return updateHostRoot(current, workInProgress, renderExpirationTime);
10650 case HostComponent:
10651 return updateHostComponent(current, workInProgress, renderExpirationTime);
10652 case HostText:
10653 return updateHostText(current, workInProgress);
10654 case CallHandlerPhase:
10655 // This is a restart. Reset the tag to the initial phase.
10656 workInProgress.tag = CallComponent;
10657 // Intentionally fall through since this is now the same.
10658 case CallComponent:
10659 return updateCallComponent(current, workInProgress, renderExpirationTime);
10660 case ReturnComponent:
10661 // A return component is just a placeholder, we can just run through the
10662 // next one immediately.
10663 return null;
10664 case HostPortal:
10665 return updatePortalComponent(current, workInProgress, renderExpirationTime);
10666 case ForwardRef:
10667 return updateForwardRef(current, workInProgress);
10668 case Fragment:
10669 return updateFragment(current, workInProgress);
10670 case Mode:
10671 return updateMode(current, workInProgress);
10672 case ContextProvider:
10673 return updateContextProvider(current, workInProgress, renderExpirationTime);
10674 case ContextConsumer:
10675 return updateContextConsumer(current, workInProgress, renderExpirationTime);
10676 default:
10677 invariant(false, 'Unknown unit of work tag. This error is likely caused by a bug in React. Please file an issue.');
10678 }
10679 }
10680
10681 return {
10682 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