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

Function beginWork

code/redux/public/app.js:10749–10792  ·  view source on GitHub ↗
(current, workInProgress, renderExpirationTime)

Source from the content-addressed store, hash-verified

10747 }
10748
10749 function beginWork(current, workInProgress, renderExpirationTime) {
10750 if (workInProgress.expirationTime === NoWork || workInProgress.expirationTime > renderExpirationTime) {
10751 return bailoutOnLowPriority(current, workInProgress);
10752 }
10753
10754 switch (workInProgress.tag) {
10755 case IndeterminateComponent:
10756 return mountIndeterminateComponent(current, workInProgress, renderExpirationTime);
10757 case FunctionalComponent:
10758 return updateFunctionalComponent(current, workInProgress);
10759 case ClassComponent:
10760 return updateClassComponent(current, workInProgress, renderExpirationTime);
10761 case HostRoot:
10762 return updateHostRoot(current, workInProgress, renderExpirationTime);
10763 case HostComponent:
10764 return updateHostComponent(current, workInProgress, renderExpirationTime);
10765 case HostText:
10766 return updateHostText(current, workInProgress);
10767 case CallHandlerPhase:
10768 // This is a restart. Reset the tag to the initial phase.
10769 workInProgress.tag = CallComponent;
10770 // Intentionally fall through since this is now the same.
10771 case CallComponent:
10772 return updateCallComponent(current, workInProgress, renderExpirationTime);
10773 case ReturnComponent:
10774 // A return component is just a placeholder, we can just run through the
10775 // next one immediately.
10776 return null;
10777 case HostPortal:
10778 return updatePortalComponent(current, workInProgress, renderExpirationTime);
10779 case ForwardRef:
10780 return updateForwardRef(current, workInProgress);
10781 case Fragment:
10782 return updateFragment(current, workInProgress);
10783 case Mode:
10784 return updateMode(current, workInProgress);
10785 case ContextProvider:
10786 return updateContextProvider(current, workInProgress, renderExpirationTime);
10787 case ContextConsumer:
10788 return updateContextConsumer(current, workInProgress, renderExpirationTime);
10789 default:
10790 invariant(false, 'Unknown unit of work tag. This error is likely caused by a bug in React. Please file an issue.');
10791 }
10792 }
10793
10794 return {
10795 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