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

Function beginWork

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

Source from the content-addressed store, hash-verified

9826 }
9827
9828 function beginWork(current, workInProgress, renderExpirationTime) {
9829 if (workInProgress.expirationTime === NoWork || workInProgress.expirationTime > renderExpirationTime) {
9830 return bailoutOnLowPriority(current, workInProgress);
9831 }
9832
9833 switch (workInProgress.tag) {
9834 case IndeterminateComponent:
9835 return mountIndeterminateComponent(current, workInProgress, renderExpirationTime);
9836 case FunctionalComponent:
9837 return updateFunctionalComponent(current, workInProgress);
9838 case ClassComponent:
9839 return updateClassComponent(current, workInProgress, renderExpirationTime);
9840 case HostRoot:
9841 return updateHostRoot(current, workInProgress, renderExpirationTime);
9842 case HostComponent:
9843 return updateHostComponent(current, workInProgress, renderExpirationTime);
9844 case HostText:
9845 return updateHostText(current, workInProgress);
9846 case CallHandlerPhase:
9847 // This is a restart. Reset the tag to the initial phase.
9848 workInProgress.tag = CallComponent;
9849 // Intentionally fall through since this is now the same.
9850 case CallComponent:
9851 return updateCallComponent(current, workInProgress, renderExpirationTime);
9852 case ReturnComponent:
9853 // A return component is just a placeholder, we can just run through the
9854 // next one immediately.
9855 return null;
9856 case HostPortal:
9857 return updatePortalComponent(current, workInProgress, renderExpirationTime);
9858 case ForwardRef:
9859 return updateForwardRef(current, workInProgress);
9860 case Fragment:
9861 return updateFragment(current, workInProgress);
9862 case Mode:
9863 return updateMode(current, workInProgress);
9864 case ContextProvider:
9865 return updateContextProvider(current, workInProgress, renderExpirationTime);
9866 case ContextConsumer:
9867 return updateContextConsumer(current, workInProgress, renderExpirationTime);
9868 default:
9869 invariant(false, 'Unknown unit of work tag. This error is likely caused by a bug in React. Please file an issue.');
9870 }
9871 }
9872
9873 return {
9874 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