useResolvePath
declare function useResolvePath(): (to: To) => Path;
interface Path {
pathname: string;
search: string;
hash: string;
}
This hook resolves the pathname of the location in the given to value against the pathname of the represented by the nearest <Route> layout or global pathname if no layout is found.
This is useful when building links from relative values.
info
useResolvePath hook is used internally by useNavigate to build relative and absolute link hrefs.