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
1.1 KiB
1.1 KiB
| id | title |
|---|---|
| RootRouteClass | RootRoute class |
Caution
This class has been deprecated and will be removed in the next major version of TanStack Router. Please use the
createRootRoutefunction instead.
The RootRoute class extends the Route class and can be used to create a root route instance. A root route instance can then be used to create a route tree.
RootRoute constructor
The RootRoute constructor accepts an object as its only argument.
Constructor options
The options that will be used to configure the root route instance.
- Type:
Omit<
RouteOptions,
| 'path'
| 'id'
| 'getParentRoute'
| 'caseSensitive'
| 'parseParams'
| 'stringifyParams'
>
RouteOptions- Optional
Constructor returns
A new Route instance.
Examples
import { RootRoute, createRouter, Outlet } from '@tanstack/react-router'
const rootRoute = new RootRoute({
component: () => <Outlet />,
// ... root route options
})
const routeTree = rootRoute.addChildren([
// ... other routes
])
const router = createRouter({
routeTree,
})