# Function useHref

- useHref(to, __namedParameters?): string

- Returns the full href for the given "to" value. This is useful for building custom links that are also accessible and preserve right-click behavior.

  #### Parameters

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

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

  #### Returns string

  #### See

  https://reactrouter.com/hooks/use-href

  - Defined in common/temp/node_modules/.pnpm/react-router@6.23.1_react@18.3.1/node_modules/react-router/dist/lib/hooks.d.ts:11