MCPcopy Index your code
hub / github.com/react/react / unwindInterruptedWork

Function unwindInterruptedWork

packages/react-reconciler/src/ReactFiberUnwindWork.js:229–308  ·  view source on GitHub ↗
(
  current: Fiber | null,
  interruptedWork: Fiber,
  renderLanes: Lanes,
)

Source from the content-addressed store, hash-verified

227}
228
229function unwindInterruptedWork(
230 current: Fiber | null,
231 interruptedWork: Fiber,
232 renderLanes: Lanes,
233) {
234 // Note: This intentionally doesn't check if we're hydrating because comparing
235 // to the current tree provider fiber is just as fast and less error-prone.
236 // Ideally we would have a special version of the work loop only
237 // for hydration.
238 popTreeContext(interruptedWork);
239 switch (interruptedWork.tag) {
240 case ClassComponent: {
241 const childContextTypes = interruptedWork.type.childContextTypes;
242 if (childContextTypes !== null && childContextTypes !== undefined) {
243 popLegacyContext(interruptedWork);
244 }
245 break;
246 }
247 case HostRoot: {
248 const root: FiberRoot = interruptedWork.stateNode;
249 const cache: Cache = interruptedWork.memoizedState.cache;
250 popCacheProvider(interruptedWork, cache);
251
252 if (enableTransitionTracing) {
253 popRootMarkerInstance(interruptedWork);
254 }
255
256 popRootTransition(interruptedWork, root, renderLanes);
257 popHostContainer(interruptedWork);
258 popTopLevelLegacyContextObject(interruptedWork);
259 break;
260 }
261 case HostHoistable:
262 case HostSingleton:
263 case HostComponent: {
264 popHostContext(interruptedWork);
265 break;
266 }
267 case HostPortal:
268 popHostContainer(interruptedWork);
269 break;
270 case ActivityComponent: {
271 if (interruptedWork.memoizedState !== null) {
272 popSuspenseHandler(interruptedWork);
273 }
274 break;
275 }
276 case SuspenseComponent:
277 popSuspenseHandler(interruptedWork);
278 break;
279 case SuspenseListComponent:
280 popSuspenseListContext(interruptedWork);
281 break;
282 case ContextProvider:
283 const context: ReactContext<any> = interruptedWork.type;
284 popProvider(context, interruptedWork);
285 break;
286 case OffscreenComponent:

Callers 2

resetWorkInProgressStackFunction · 0.90
replayBeginWorkFunction · 0.90

Calls 12

popTreeContextFunction · 0.90
popCacheProviderFunction · 0.90
popRootMarkerInstanceFunction · 0.90
popRootTransitionFunction · 0.90
popHostContainerFunction · 0.90
popHostContextFunction · 0.90
popSuspenseHandlerFunction · 0.90
popSuspenseListContextFunction · 0.90
popProviderFunction · 0.90
popHiddenContextFunction · 0.90
popTransitionFunction · 0.90
popMarkerInstanceFunction · 0.90

Tested by

no test coverage detected