mirror of
https://github.com/TanStack/router.git
synced 2026-11-16 19:38:07 +00:00
* docs: reference docs * docs: guides * docs: top-level * docs: missed the route-trees * docs: fixing routing-concepts
960 B
960 B
| id | title |
|---|---|
| RouterClass | Router Class |
Caution
This class has been deprecated and will be removed in the next major version of TanStack Router. Please use the
createRouterfunction instead.
The Router class is used to instantiate a new router instance.
Router constructor
The Router constructor accepts a single argument: the options that will be used to configure the router instance.
Constructor options
- Type:
RouterOptions - Required
- The options that will be used to configure the router instance.
Constructor returns
- An instance of the
Router.
Examples
import { Router, RouterProvider } from '@tanstack/react-router'
import { routeTree } from './routeTree.gen'
const router = new Router({
routeTree,
defaultPreload: 'intent',
})
export default function App() {
return <RouterProvider router={router} />
}