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

Function beginWork

code/one-direction-data-flow/public/app.js:10371–10414  ·  view source on GitHub ↗
(current, workInProgress, renderExpirationTime)

Source from the content-addressed store, hash-verified

10369 }
10370
10371 function beginWork(current, workInProgress, renderExpirationTime) {
10372 if (workInProgress.expirationTime === NoWork || workInProgress.expirationTime > renderExpirationTime) {
10373 return bailoutOnLowPriority(current, workInProgress);
10374 }
10375
10376 switch (workInProgress.tag) {
10377 case IndeterminateComponent:
10378 return mountIndeterminateComponent(current, workInProgress, renderExpirationTime);
10379 case FunctionalComponent:
10380 return updateFunctionalComponent(current, workInProgress);
10381 case ClassComponent:
10382 return updateClassComponent(current, workInProgress, renderExpirationTime);
10383 case HostRoot:
10384 return updateHostRoot(current, workInProgress, renderExpirationTime);
10385 case HostComponent:
10386 return updateHostComponent(current, workInProgress, renderExpirationTime);
10387 case HostText:
10388 return updateHostText(current, workInProgress);
10389 case CallHandlerPhase:
10390 // This is a restart. Reset the tag to the initial phase.
10391 workInProgress.tag = CallComponent;
10392 // Intentionally fall through since this is now the same.
10393 case CallComponent:
10394 return updateCallComponent(current, workInProgress, renderExpirationTime);
10395 case ReturnComponent:
10396 // A return component is just a placeholder, we can just run through the
10397 // next one immediately.
10398 return null;
10399 case HostPortal:
10400 return updatePortalComponent(current, workInProgress, renderExpirationTime);
10401 case ForwardRef:
10402 return updateForwardRef(current, workInProgress);
10403 case Fragment:
10404 return updateFragment(current, workInProgress);
10405 case Mode:
10406 return updateMode(current, workInProgress);
10407 case ContextProvider:
10408 return updateContextProvider(current, workInProgress, renderExpirationTime);
10409 case ContextConsumer:
10410 return updateContextConsumer(current, workInProgress, renderExpirationTime);
10411 default:
10412 invariant(false, 'Unknown unit of work tag. This error is likely caused by a bug in React. Please file an issue.');
10413 }
10414 }
10415
10416 return {
10417 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