# Function unstable_useViewTransitionState

- unstable_useViewTransitionState(to, opts?): boolean

- Return a boolean indicating if there is an active view transition to the given href. You can use this value to render CSS classes or viewTransitionName styles onto your elements

  #### Parameters

  - to: To
  - `Optional` opts: {
    relative?: RelativeRoutingType;
    }

    - ##### `Optional` relative?: RelativeRoutingType

      Relative routing type ("route" | "path")

  #### Returns boolean

  - Defined in common/temp/node_modules/.pnpm/react-router-dom@6.23.1_react-dom@18.3.1+react@18.3.1/node_modules/react-router-dom/dist/index.d.ts:316