useRouter

external fun useRouter(options: UseRouterOptions = definedExternally): Router(source)

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).

API Docs

Return

The registered router instance.