MCPcopy Create free account
hub / github.com/reactjs/react-rails / unwindWork

Function unwindWork

lib/assets/react-source/development/react.js:23041–23118  ·  view source on GitHub ↗
(workInProgress, renderExpirationTime)

Source from the content-addressed store, hash-verified

23039 }
23040
23041 function unwindWork(workInProgress, renderExpirationTime) {
23042 switch (workInProgress.tag) {
23043 case ClassComponent:
23044 {
23045 var Component = workInProgress.type;
23046
23047 if (isContextProvider(Component)) {
23048 popContext(workInProgress);
23049 }
23050
23051 var effectTag = workInProgress.effectTag;
23052
23053 if (effectTag & ShouldCapture) {
23054 workInProgress.effectTag = effectTag & ~ShouldCapture | DidCapture;
23055 return workInProgress;
23056 }
23057
23058 return null;
23059 }
23060
23061 case HostRoot:
23062 {
23063 popHostContainer(workInProgress);
23064 popTopLevelContextObject(workInProgress);
23065 var _effectTag = workInProgress.effectTag;
23066
23067 if (!((_effectTag & DidCapture) === NoEffect)) {
23068 {
23069 throw Error( "The root failed to unmount after an error. This is likely a bug in React. Please file an issue." );
23070 }
23071 }
23072
23073 workInProgress.effectTag = _effectTag & ~ShouldCapture | DidCapture;
23074 return workInProgress;
23075 }
23076
23077 case HostComponent:
23078 {
23079 // TODO: popHydrationState
23080 popHostContext(workInProgress);
23081 return null;
23082 }
23083
23084 case SuspenseComponent:
23085 {
23086 popSuspenseContext(workInProgress);
23087
23088 var _effectTag2 = workInProgress.effectTag;
23089
23090 if (_effectTag2 & ShouldCapture) {
23091 workInProgress.effectTag = _effectTag2 & ~ShouldCapture | DidCapture; // Captured a suspense effect. Re-render the boundary.
23092
23093 return workInProgress;
23094 }
23095
23096 return null;
23097 }
23098

Callers 1

completeUnitOfWorkFunction · 0.85

Calls 7

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

Tested by

no test coverage detected