Home / Function/ updateSuspenseOffscreenState() — react Function Reference

updateSuspenseOffscreenState() — react Function Reference

Architecture documentation for the updateSuspenseOffscreenState() function in ReactFiberBeginWork.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  d12b091d_ef71_243e_cea5_ca54658c0b46["updateSuspenseOffscreenState()"]
  0be70812_cc0c_b210_f84f_8e61dd5f831c["ReactFiberBeginWork.js"]
  d12b091d_ef71_243e_cea5_ca54658c0b46 -->|defined in| 0be70812_cc0c_b210_f84f_8e61dd5f831c
  f4acdab6_f680_af63_8940_0259a68c2f48["updateSuspenseComponent()"]
  f4acdab6_f680_af63_8940_0259a68c2f48 -->|calls| d12b091d_ef71_243e_cea5_ca54658c0b46
  style d12b091d_ef71_243e_cea5_ca54658c0b46 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-reconciler/src/ReactFiberBeginWork.js lines 2265–2295

function updateSuspenseOffscreenState(
  prevOffscreenState: OffscreenState,
  renderLanes: Lanes,
): OffscreenState {
  let cachePool: SpawnedCachePool | null = null;
  const prevCachePool: SpawnedCachePool | null = prevOffscreenState.cachePool;
  if (prevCachePool !== null) {
    const parentCache = isPrimaryRenderer
      ? CacheContext._currentValue
      : CacheContext._currentValue2;
    if (prevCachePool.parent !== parentCache) {
      // Detected a refresh in the parent. This overrides any previously
      // suspended cache.
      cachePool = {
        parent: parentCache,
        pool: parentCache,
      };
    } else {
      // We can reuse the cache from last time. The only thing that would have
      // overridden it is a parent refresh, which we checked for above.
      cachePool = prevCachePool;
    }
  } else {
    // If there's no previous cache pool, grab the current one.
    cachePool = getSuspendedCache();
  }
  return {
    baseLanes: mergeLanes(prevOffscreenState.baseLanes, renderLanes),
    cachePool,
  };
}

Domain

Subdomains

Frequently Asked Questions

What does updateSuspenseOffscreenState() do?
updateSuspenseOffscreenState() is a function in the react codebase, defined in packages/react-reconciler/src/ReactFiberBeginWork.js.
Where is updateSuspenseOffscreenState() defined?
updateSuspenseOffscreenState() is defined in packages/react-reconciler/src/ReactFiberBeginWork.js at line 2265.
What calls updateSuspenseOffscreenState()?
updateSuspenseOffscreenState() is called by 1 function(s): updateSuspenseComponent.

Analyze Your Own Codebase

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

Try Supermodel Free