alepha@docs:~/docs/reference/react-hooks$
cat useRouter.md
1 min read
Last commit:

#useRouter

#Import

typescript
1import { useRouter } from "alepha/react/router";

#Overview

Use this hook to access the React Router instance.

You can add a type parameter to specify the type of your application. This will allow you to use the router in a typesafe way.

#Examples

class App { home = $page(); }

const router = useRouter(); router.push("home"); // typesafe