MCPcopy Create free account
hub / github.com/microsoft/SandDance / unwindWork

Function unwindWork

docs/external/js/react-dom.development.js:19481–19558  ·  view source on GitHub ↗
(workInProgress, renderExpirationTime)

Source from the content-addressed store, hash-verified

19479 }
19480
19481 function unwindWork(workInProgress, renderExpirationTime) {
19482 switch (workInProgress.tag) {
19483 case ClassComponent:
19484 {
19485 var Component = workInProgress.type;
19486
19487 if (isContextProvider(Component)) {
19488 popContext(workInProgress);
19489 }
19490
19491 var effectTag = workInProgress.effectTag;
19492
19493 if (effectTag & ShouldCapture) {
19494 workInProgress.effectTag = effectTag & ~ShouldCapture | DidCapture;
19495 return workInProgress;
19496 }
19497
19498 return null;
19499 }
19500
19501 case HostRoot:
19502 {
19503 popHostContainer(workInProgress);
19504 popTopLevelContextObject(workInProgress);
19505 var _effectTag = workInProgress.effectTag;
19506
19507 if (!((_effectTag & DidCapture) === NoEffect)) {
19508 {
19509 throw Error( "The root failed to unmount after an error. This is likely a bug in React. Please file an issue." );
19510 }
19511 }
19512
19513 workInProgress.effectTag = _effectTag & ~ShouldCapture | DidCapture;
19514 return workInProgress;
19515 }
19516
19517 case HostComponent:
19518 {
19519 // TODO: popHydrationState
19520 popHostContext(workInProgress);
19521 return null;
19522 }
19523
19524 case SuspenseComponent:
19525 {
19526 popSuspenseContext(workInProgress);
19527
19528 var _effectTag2 = workInProgress.effectTag;
19529
19530 if (_effectTag2 & ShouldCapture) {
19531 workInProgress.effectTag = _effectTag2 & ~ShouldCapture | DidCapture; // Captured a suspense effect. Re-render the boundary.
19532
19533 return workInProgress;
19534 }
19535
19536 return null;
19537 }
19538

Callers 1

completeUnitOfWorkFunction · 0.85

Calls 7

isContextProviderFunction · 0.85
popContextFunction · 0.85
popHostContainerFunction · 0.85
popTopLevelContextObjectFunction · 0.85
popHostContextFunction · 0.85
popSuspenseContextFunction · 0.85
popProviderFunction · 0.85

Tested by

no test coverage detected