Skip to content

Commit

Permalink
📝 docs(Quick Start): update Root config guide (#426)
Browse files Browse the repository at this point in the history
* 📝 docs(Quick Start): update Root config guide

Closes: #425

* Update quick-start.md

Co-authored-by: Tanner Linsley <tannerlinsley@gmail.com>
  • Loading branch information
moshyfawn and tannerlinsley committed Dec 7, 2022
1 parent 9d35116 commit 4ad3b0b
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions docs/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,17 @@ import {
createRouteConfig,
} from '@tanstack/react-router'

const rootRoute = createRouteConfig()
const rootRoute = createRouteConfig({
component: () => (
<>
<div>
<Link to="/">Home</Link> <Link to="/about">About</Link>
</div>
<hr />
<Outlet />
</>
)
})

const indexRoute = rootRoute.createRoute({
path: '/',
Expand All @@ -32,17 +42,7 @@ const routeConfig = rootRoute.addChildren([indexRoute, aboutRoute])
const router = createReactRouter({ routeConfig })

function App() {
return (
<>
<RouterProvider router={router}>
<div>
<Link to="/">Home</Link> <Link to="/about">About</Link>
</div>
<hr />
<Outlet />
</RouterProvider>
</>
)
return <RouterProvider router={router} />
}

function Index() {
Expand Down

0 comments on commit 4ad3b0b

Please sign in to comment.