Skip to content

navigate

Programmatically navigate to a route with dynamic params and query objects.

import { navigate } from "@hellajs/router";
// Go to /about
navigate("/about");
// Go to /user/123?tab=profile
navigate(
"/user", // Path
{ id: "123" }, // Params
{ tab: "profile"} // Query
);
// Replace current history entry
navigate("/login", {}, {}, { replace: true });