useViewTransitionState
react-router

useViewTransitionState

useViewTransitionState(to, opts): boolean

This hook returns true when there is an active View Transition to the specified location. This can be used to apply finer-grained styles to elements to further customize the view transition. This requires that view transitions have been enabled for the given navigation via LinkProps.viewTransition (or the Form, submit, or navigate call)

Parameters

  • to: To
  • opts: { relative: RelativeRoutingType, }
Docs and examples CC 4.0