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

Function beginWork

code/new-context-api/public/app.js:9859–9902  ·  view source on GitHub ↗
(current, workInProgress, renderExpirationTime)

Source from the content-addressed store, hash-verified

9857 }
9858
9859 function beginWork(current, workInProgress, renderExpirationTime) {
9860 if (workInProgress.expirationTime === NoWork || workInProgress.expirationTime > renderExpirationTime) {
9861 return bailoutOnLowPriority(current, workInProgress);
9862 }
9863
9864 switch (workInProgress.tag) {
9865 case IndeterminateComponent:
9866 return mountIndeterminateComponent(current, workInProgress, renderExpirationTime);
9867 case FunctionalComponent:
9868 return updateFunctionalComponent(current, workInProgress);
9869 case ClassComponent:
9870 return updateClassComponent(current, workInProgress, renderExpirationTime);
9871 case HostRoot:
9872 return updateHostRoot(current, workInProgress, renderExpirationTime);
9873 case HostComponent:
9874 return updateHostComponent(current, workInProgress, renderExpirationTime);
9875 case HostText:
9876 return updateHostText(current, workInProgress);
9877 case CallHandlerPhase:
9878 // This is a restart. Reset the tag to the initial phase.
9879 workInProgress.tag = CallComponent;
9880 // Intentionally fall through since this is now the same.
9881 case CallComponent:
9882 return updateCallComponent(current, workInProgress, renderExpirationTime);
9883 case ReturnComponent:
9884 // A return component is just a placeholder, we can just run through the
9885 // next one immediately.
9886 return null;
9887 case HostPortal:
9888 return updatePortalComponent(current, workInProgress, renderExpirationTime);
9889 case ForwardRef:
9890 return updateForwardRef(current, workInProgress);
9891 case Fragment:
9892 return updateFragment(current, workInProgress);
9893 case Mode:
9894 return updateMode(current, workInProgress);
9895 case ContextProvider:
9896 return updateContextProvider(current, workInProgress, renderExpirationTime);
9897 case ContextConsumer:
9898 return updateContextConsumer(current, workInProgress, renderExpirationTime);
9899 default:
9900 invariant(false, 'Unknown unit of work tag. This error is likely caused by a bug in React. Please file an issue.');
9901 }
9902 }
9903
9904 return {
9905 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