Back to React Router

href

docs/api/utils/href.md

7.6.2321 B
Original Source

href

[MODES: framework]

Summary

Reference Documentation ↗

Returns a resolved URL path for the specified route.

tsx
const h = href("/:lang?/about", { lang: "en" })
// -> `/en/about`

<Link to={href("/products/:id", { id: "abc123" })} />