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

Function beginWork

code/third-party/public/app.js:9731–9774  ·  view source on GitHub ↗
(current, workInProgress, renderExpirationTime)

Source from the content-addressed store, hash-verified

9729 }
9730
9731 function beginWork(current, workInProgress, renderExpirationTime) {
9732 if (workInProgress.expirationTime === NoWork || workInProgress.expirationTime > renderExpirationTime) {
9733 return bailoutOnLowPriority(current, workInProgress);
9734 }
9735
9736 switch (workInProgress.tag) {
9737 case IndeterminateComponent:
9738 return mountIndeterminateComponent(current, workInProgress, renderExpirationTime);
9739 case FunctionalComponent:
9740 return updateFunctionalComponent(current, workInProgress);
9741 case ClassComponent:
9742 return updateClassComponent(current, workInProgress, renderExpirationTime);
9743 case HostRoot:
9744 return updateHostRoot(current, workInProgress, renderExpirationTime);
9745 case HostComponent:
9746 return updateHostComponent(current, workInProgress, renderExpirationTime);
9747 case HostText:
9748 return updateHostText(current, workInProgress);
9749 case CallHandlerPhase:
9750 // This is a restart. Reset the tag to the initial phase.
9751 workInProgress.tag = CallComponent;
9752 // Intentionally fall through since this is now the same.
9753 case CallComponent:
9754 return updateCallComponent(current, workInProgress, renderExpirationTime);
9755 case ReturnComponent:
9756 // A return component is just a placeholder, we can just run through the
9757 // next one immediately.
9758 return null;
9759 case HostPortal:
9760 return updatePortalComponent(current, workInProgress, renderExpirationTime);
9761 case ForwardRef:
9762 return updateForwardRef(current, workInProgress);
9763 case Fragment:
9764 return updateFragment(current, workInProgress);
9765 case Mode:
9766 return updateMode(current, workInProgress);
9767 case ContextProvider:
9768 return updateContextProvider(current, workInProgress, renderExpirationTime);
9769 case ContextConsumer:
9770 return updateContextConsumer(current, workInProgress, renderExpirationTime);
9771 default:
9772 invariant(false, 'Unknown unit of work tag. This error is likely caused by a bug in React. Please file an issue.');
9773 }
9774 }
9775
9776 return {
9777 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