NarraLeaf

useRouter

The useRouter hook, which creates or retrieves a Router instance for navigating the LayoutRouter tree.

Create a router instance.

import { useRouter } from "narraleaf-react";
const router = useRouter();

Definition

function useRouter(defaultId?: string): Router;

For more information about the router instance, please check Router.

On this page