Home / Function/ applyUpdateViewTransition() — react Function Reference

applyUpdateViewTransition() — react Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  6e9b9423_2aa1_96c1_1185_f860250923b6["applyUpdateViewTransition()"]
  ee850b36_fc0b_9bb2_5b69_58d705aef9a5["ReactFiberApplyGesture.js"]
  6e9b9423_2aa1_96c1_1185_f860250923b6 -->|defined in| ee850b36_fc0b_9bb2_5b69_58d705aef9a5
  585297c1_5fbc_f778_b0fa_7f11968cec48["insertDestinationClonesOfFiber()"]
  585297c1_5fbc_f778_b0fa_7f11968cec48 -->|calls| 6e9b9423_2aa1_96c1_1185_f860250923b6
  fb6ac8c2_1325_f769_79fa_77c9d16252f1["getViewTransitionName()"]
  6e9b9423_2aa1_96c1_1185_f860250923b6 -->|calls| fb6ac8c2_1325_f769_79fa_77c9d16252f1
  be70b440_45eb_ff76_0bc6_50898635623c["getViewTransitionClassName()"]
  6e9b9423_2aa1_96c1_1185_f860250923b6 -->|calls| be70b440_45eb_ff76_0bc6_50898635623c
  45145b45_9179_2a0e_5b39_0f8c3bceb8c9["applyViewTransitionToClones()"]
  6e9b9423_2aa1_96c1_1185_f860250923b6 -->|calls| 45145b45_9179_2a0e_5b39_0f8c3bceb8c9
  style 6e9b9423_2aa1_96c1_1185_f860250923b6 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-reconciler/src/ReactFiberApplyGesture.js lines 352–381

function applyUpdateViewTransition(current: Fiber, finishedWork: Fiber): void {
  const state: ViewTransitionState = finishedWork.stateNode;
  // Updates can have conflicting names and classNames.
  // Since we're doing a reverse animation the "new" state is actually the current
  // and the "old" state is the finishedWork.
  const newProps: ViewTransitionProps = current.memoizedProps;
  const oldProps: ViewTransitionProps = finishedWork.memoizedProps;
  const oldName = getViewTransitionName(oldProps, state);
  // This className applies only if there are fewer child DOM nodes than
  // before or if this update should've been cancelled but we ended up with
  // a parent animating so we need to animate the child too. Otherwise
  // the "new" state wins. Since "new" normally wins, that's usually what
  // we would use. However, since this animation is going in reverse we actually
  // want the props from "current" since that's the class that would've won if
  // it was the normal direction. To preserve the same effect in either direction.
  const className: ?string = getViewTransitionClassName(
    newProps.default,
    newProps.update,
  );
  if (className === 'none') {
    // If update is "none" then we don't have to apply a name. Since we won't animate this boundary.
    return;
  }
  const clones = state.clones;
  // If there are no clones at this point, that should mean that there are no
  // HostComponent children in this ViewTransition.
  if (clones !== null) {
    applyViewTransitionToClones(oldName, className, clones, finishedWork);
  }
}

Domain

Subdomains

Frequently Asked Questions

What does applyUpdateViewTransition() do?
applyUpdateViewTransition() is a function in the react codebase, defined in packages/react-reconciler/src/ReactFiberApplyGesture.js.
Where is applyUpdateViewTransition() defined?
applyUpdateViewTransition() is defined in packages/react-reconciler/src/ReactFiberApplyGesture.js at line 352.
What does applyUpdateViewTransition() call?
applyUpdateViewTransition() calls 3 function(s): applyViewTransitionToClones, getViewTransitionClassName, getViewTransitionName.
What calls applyUpdateViewTransition()?
applyUpdateViewTransition() is called by 1 function(s): insertDestinationClonesOfFiber.

Analyze Your Own Codebase

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

Try Supermodel Free