Home / Function/ unwindInterruptedWork() — react Function Reference

unwindInterruptedWork() — react Function Reference

Architecture documentation for the unwindInterruptedWork() function in ReactFiberUnwindWork.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  0858c166_63a6_03b3_cf3f_1f44b4c20708["unwindInterruptedWork()"]
  53e7e9e3_9e8c_648e_1f4e_0fdfa5c5cb8f["ReactFiberUnwindWork.js"]
  0858c166_63a6_03b3_cf3f_1f44b4c20708 -->|defined in| 53e7e9e3_9e8c_648e_1f4e_0fdfa5c5cb8f
  696b3a85_2c29_d1fc_9da0_cb0ebaa5bcff["popCacheProvider()"]
  0858c166_63a6_03b3_cf3f_1f44b4c20708 -->|calls| 696b3a85_2c29_d1fc_9da0_cb0ebaa5bcff
  2343b46f_12ff_c0a8_2d57_670c055844f4["popRootMarkerInstance()"]
  0858c166_63a6_03b3_cf3f_1f44b4c20708 -->|calls| 2343b46f_12ff_c0a8_2d57_670c055844f4
  3a69c559_be56_4689_1458_b935319852cb["popHostContainer()"]
  0858c166_63a6_03b3_cf3f_1f44b4c20708 -->|calls| 3a69c559_be56_4689_1458_b935319852cb
  d1a95e98_467c_e9b8_af34_7d3813a82b6b["popHostContext()"]
  0858c166_63a6_03b3_cf3f_1f44b4c20708 -->|calls| d1a95e98_467c_e9b8_af34_7d3813a82b6b
  59929453_9f09_a335_22ac_e0e931c51842["popSuspenseHandler()"]
  0858c166_63a6_03b3_cf3f_1f44b4c20708 -->|calls| 59929453_9f09_a335_22ac_e0e931c51842
  3be97342_d10e_c947_1b45_9c2bb900f73a["popSuspenseListContext()"]
  0858c166_63a6_03b3_cf3f_1f44b4c20708 -->|calls| 3be97342_d10e_c947_1b45_9c2bb900f73a
  ac44a064_efde_6180_750f_70488159ba8a["popHiddenContext()"]
  0858c166_63a6_03b3_cf3f_1f44b4c20708 -->|calls| ac44a064_efde_6180_750f_70488159ba8a
  7e859251_7f78_1520_7488_1ea657edb327["popMarkerInstance()"]
  0858c166_63a6_03b3_cf3f_1f44b4c20708 -->|calls| 7e859251_7f78_1520_7488_1ea657edb327
  style 0858c166_63a6_03b3_cf3f_1f44b4c20708 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-reconciler/src/ReactFiberUnwindWork.js lines 251–330

function unwindInterruptedWork(
  current: Fiber | null,
  interruptedWork: Fiber,
  renderLanes: Lanes,
) {
  // Note: This intentionally doesn't check if we're hydrating because comparing
  // to the current tree provider fiber is just as fast and less error-prone.
  // Ideally we would have a special version of the work loop only
  // for hydration.
  popTreeContext(interruptedWork);
  switch (interruptedWork.tag) {
    case ClassComponent: {
      const childContextTypes = interruptedWork.type.childContextTypes;
      if (childContextTypes !== null && childContextTypes !== undefined) {
        popLegacyContext(interruptedWork);
      }
      break;
    }
    case HostRoot: {
      const root: FiberRoot = interruptedWork.stateNode;
      const cache: Cache = interruptedWork.memoizedState.cache;
      popCacheProvider(interruptedWork, cache);

      if (enableTransitionTracing) {
        popRootMarkerInstance(interruptedWork);
      }

      popRootTransition(interruptedWork, root, renderLanes);
      popHostContainer(interruptedWork);
      popTopLevelLegacyContextObject(interruptedWork);
      break;
    }
    case HostHoistable:
    case HostSingleton:
    case HostComponent: {
      popHostContext(interruptedWork);
      break;
    }
    case HostPortal:
      popHostContainer(interruptedWork);
      break;
    case ActivityComponent: {
      if (interruptedWork.memoizedState !== null) {
        popSuspenseHandler(interruptedWork);
      }
      break;
    }
    case SuspenseComponent:
      popSuspenseHandler(interruptedWork);
      break;
    case SuspenseListComponent:
      popSuspenseListContext(interruptedWork);
      break;
    case ContextProvider:
      const context: ReactContext<any> = interruptedWork.type;
      popProvider(context, interruptedWork);
      break;
    case OffscreenComponent:
    case LegacyHiddenComponent:
      popSuspenseHandler(interruptedWork);
      popHiddenContext(interruptedWork);
      popTransition(interruptedWork, current);
      break;
    case CacheComponent:
      const cache: Cache = interruptedWork.memoizedState.cache;
      popCacheProvider(interruptedWork, cache);
      break;
    case TracingMarkerComponent:
      if (enableTransitionTracing) {
        const instance: TracingMarkerInstance | null =
          interruptedWork.stateNode;
        if (instance !== null) {
          popMarkerInstance(interruptedWork);
        }
      }
      break;
    default:
      break;
  }
}

Domain

Subdomains

Frequently Asked Questions

What does unwindInterruptedWork() do?
unwindInterruptedWork() is a function in the react codebase, defined in packages/react-reconciler/src/ReactFiberUnwindWork.js.
Where is unwindInterruptedWork() defined?
unwindInterruptedWork() is defined in packages/react-reconciler/src/ReactFiberUnwindWork.js at line 251.
What does unwindInterruptedWork() call?
unwindInterruptedWork() calls 8 function(s): popCacheProvider, popHiddenContext, popHostContainer, popHostContext, popMarkerInstance, popRootMarkerInstance, popSuspenseHandler, popSuspenseListContext.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free