useRouter

Flareact provides access to the router instance using the useRouter() hook:

import { useRouter } from "flareact/router";

export default function Index() {
  const router = useRouter();

  // Inspect the pathname
  router.pathname;

  // Navigate to the /about page
  router.push("/about");

  // Navigate to the dynamic route /posts/[slug] using `href`, `as`
  router.push("/posts/[slug]", "/posts/my-first-post");
}