--- title: generatePath --- # generatePath [MODES: framework, data, declarative] ## Summary [Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react_router.generatePath.html) Returns a path with params interpolated. ```tsx import { generatePath } from "react-router"; generatePath("/users/:id", { id: "123" }); // "/users/123" ``` ## Signature ```tsx function generatePath( originalPath: Path, params: { [key in PathParam]: string | null; } = as any, ): string {} ``` ## Params ### originalPath The original path to generate. ### params The parameters to interpolate into the path. ## Returns The generated path with parameters interpolated.