UNPKG

@tanstack/react-router

Version:

Modern and scalable routing for React applications

15 lines (14 loc) 535 B
import { AnyRouter, RegisteredRouter } from '@tanstack/router-core'; /** * Access the current TanStack Router instance from React context. * Must be used within a `RouterProvider`. * * Options: * - `warn`: Log a warning if no router context is found (default: true). * * @returns The registered router instance. * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useRouterHook */ export declare function useRouter<TRouter extends AnyRouter = RegisteredRouter>(opts?: { warn?: boolean; }): TRouter;