React Router API Reference
    Preparing search index...

    Function href

    • Returns a resolved URL path for the specified route.

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

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

      Type Parameters

      • Path extends string

      Parameters

      • path: Path
      • ...args: [] | [AnyParams]

      Returns string