Home / Function/ restoreViewTransitionsOnFiber() — react Function Reference

restoreViewTransitionsOnFiber() — react Function Reference

Architecture documentation for the restoreViewTransitionsOnFiber() function in ReactFiberApplyGesture.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  4c9257f7_64ef_4251_034e_92da1c758743["restoreViewTransitionsOnFiber()"]
  ee850b36_fc0b_9bb2_5b69_58d705aef9a5["ReactFiberApplyGesture.js"]
  4c9257f7_64ef_4251_034e_92da1c758743 -->|defined in| ee850b36_fc0b_9bb2_5b69_58d705aef9a5
  00ef35cd_e1f7_60eb_6cfc_26776c2a9fec["recursivelyRestoreViewTransitions()"]
  00ef35cd_e1f7_60eb_6cfc_26776c2a9fec -->|calls| 4c9257f7_64ef_4251_034e_92da1c758743
  3331a971_ccc2_f7cf_15f8_4ccecaca1975["startGestureAnimations()"]
  3331a971_ccc2_f7cf_15f8_4ccecaca1975 -->|calls| 4c9257f7_64ef_4251_034e_92da1c758743
  00ef35cd_e1f7_60eb_6cfc_26776c2a9fec["recursivelyRestoreViewTransitions()"]
  4c9257f7_64ef_4251_034e_92da1c758743 -->|calls| 00ef35cd_e1f7_60eb_6cfc_26776c2a9fec
  style 4c9257f7_64ef_4251_034e_92da1c758743 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-reconciler/src/ReactFiberApplyGesture.js lines 1288–1326

function restoreViewTransitionsOnFiber(finishedWork: Fiber) {
  const current = finishedWork.alternate;
  if (current === null) {
    restoreEnterOrExitViewTransitions(finishedWork);
    return;
  }

  const flags = finishedWork.flags;
  // The effect flag should be checked *after* we refine the type of fiber,
  // because the fiber tag is more specific. An exception is any flag related
  // to reconciliation, because those can be set on all fiber types.
  switch (finishedWork.tag) {
    case HostPortal: {
      // TODO: Consider what should happen to Portals. For now we exclude them.
      break;
    }
    case OffscreenComponent: {
      if (flags & Visibility) {
        const newState: OffscreenState | null = finishedWork.memoizedState;
        const isHidden = newState !== null;
        if (!isHidden) {
          restoreEnterOrExitViewTransitions(finishedWork);
        } else if (current !== null && current.memoizedState === null) {
          // Was previously mounted as visible but is now hidden.
          restoreEnterOrExitViewTransitions(current);
        }
      }
      break;
    }
    case ViewTransitionComponent:
      restoreUpdateViewTransitionForGesture(current, finishedWork);
      recursivelyRestoreViewTransitions(finishedWork);
      break;
    default: {
      recursivelyRestoreViewTransitions(finishedWork);
      break;
    }
  }
}

Domain

Subdomains

Frequently Asked Questions

What does restoreViewTransitionsOnFiber() do?
restoreViewTransitionsOnFiber() is a function in the react codebase, defined in packages/react-reconciler/src/ReactFiberApplyGesture.js.
Where is restoreViewTransitionsOnFiber() defined?
restoreViewTransitionsOnFiber() is defined in packages/react-reconciler/src/ReactFiberApplyGesture.js at line 1288.
What does restoreViewTransitionsOnFiber() call?
restoreViewTransitionsOnFiber() calls 1 function(s): recursivelyRestoreViewTransitions.
What calls restoreViewTransitionsOnFiber()?
restoreViewTransitionsOnFiber() is called by 2 function(s): recursivelyRestoreViewTransitions, startGestureAnimations.

Analyze Your Own Codebase

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

Try Supermodel Free