---
title: useResolvedPath
---
# `useResolvedPath`
Type declaration
```tsx
declare function useResolvedPath(
to: To,
options?: { relative?: RelativeRoutingType }
): Path;
```
This hook resolves the `pathname` of the location in the given `to` value against the pathname of the current location.
This is useful when building links from relative values. For example, check out the source to [``][navlink] which calls `useResolvedPath` internally to resolve the full pathname of the page being linked to.
See [resolvePath][resolvepath] for more information.
## Splat Paths
The original logic for `useResolvedPath` behaved differently for splat paths which in hindsight was incorrect/buggy behavior. This was fixed in [`6.19.0`][release-6.19.0] but it was determined that a large number of existing applications [relied on this behavior][revert-comment] so the fix was reverted in [`6.20.1`][release-6.20.1] and re-introduced in [`6.21.0`][release-6.21.0] behind a `future.v7_relativeSplatPath` [future flag][future-flag]. This will become the default behavior in React Router v7, so it is recommended to update your applications at your convenience to be better prepared for the eventual v7 upgrade.
It should be noted that this is the foundation for all relative routing in React Router, so this applies to the following relative path code flows as well:
- ``
- `useNavigate()`
- `useHref()`
- `