Skip to content
Source
Sign inSign up
TanStack/router
Open History to see the last commit

__root.tsx

37 lines868 Bytes

1import { TanStackRouterDevtools } from '@tanstack/react-router-devtools'
2import * as React from 'react'
3import { createRouteConfig, Link, Outlet } from '@tanstack/react-router'
4​
5createRouteConfig({
6 component: Root,
7})
8​
9function Root() {
10 return (
11 <>
12 <div className="p-2 flex gap-2 text-lg">
13 <Link
14 to="/"
15 activeProps={{
16 className: 'font-bold',
17 }}
18 activeOptions={{ exact: true }}
19 >
20 Home
21 </Link>{' '}
22 <Link
23 to="/posts"
24 activeProps={{
25 className: 'font-bold',
26 }}
27 >
28 Posts
29 </Link>
30 </div>
31 <hr />
32 <Outlet /> {/* Start rendering router matches */}
33 <TanStackRouterDevtools position="bottom-right" />
34 <script type="module" src="/src/entry-client.tsx"></script>
35 </>
36 )