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
729 B
729 B
| id | title |
|---|---|
| createRouterFunction | createRouter function |
The createRouter function accepts a RouterOptions object and creates a new Router instance.
createRouter options
- Type:
RouterOptions - Required
- The options that will be used to configure the router instance.
createRouter returns
- An instance of the
Router.
Examples
import { createRouter, RouterProvider } from '@tanstack/react-router'
import { routeTree } from './routeTree.gen'
const router = createRouter({
routeTree,
defaultPreload: 'intent',
})
export default function App() {
return <RouterProvider router={router} />
}