---
title: useViewTransitionState
---

# useViewTransitionState

[MODES: framework, data]

## Summary

[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react_router.useViewTransitionState.html)

This hook returns `true` when there is an active [View Transition](https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API) 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)

## Signature

```tsx
useViewTransitionState(to, opts): boolean
```

## Params

### to

[modes: framework, data, declarative]

_No documentation_

### opts

[modes: framework, data, declarative]

_No documentation_
