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

__root.client.tsx

30 lines904 Bytes

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