Skip to content

Latest commit

 

History

History
45 lines (29 loc) · 874 Bytes

useResolvedPath.md

File metadata and controls

45 lines (29 loc) · 874 Bytes
title
useResolvedPath

useResolvedPath

[MODES: framework, data, declarative]

Summary

Reference Documentation ↗

Resolves the pathname of the given to value against the current location. Similar to useHref, but returns a Path instead of a string.

import { useResolvedPath } from "react-router";

function SomeComponent() {
  // if the user is at /dashboard/profile
  let path = useResolvedPath("../accounts");
  path.pathname; // "/dashboard/accounts"
  path.search; // ""
  path.hash; // ""
}

Signature

useResolvedPath(to, __namedParameters): Path

Params

to

[modes: framework, data, declarative]

No documentation

__namedParameters

[modes: framework, data, declarative]

No documentation