React Router API Reference
    Preparing search index...

    Function generatePath

    • Returns a path with params interpolated.

      Type Parameters

      • Path extends string

      Parameters

      • originalPath: Path

        The original path to generate.

      • params: { [key in "*"]: null | string } = ...

        The parameters to interpolate into the path.

      Returns string

      The generated path with parameters interpolated.

      import { generatePath } from "react-router";

      generatePath("/users/:id", { id: "123" }); // "/users/123"

      @public