Open History to see the last commit
1import { ClientOnly, Link, Outlet, linkOptions } from '@tanstack/react-router'
2import styles from '~/styles/root-shell.module.css'
3β
4const ROUTES = linkOptions([
5 { to: '/', label: 'home' },
6 { to: '/a', label: '/a' },
7 { to: '/b', label: '/b' },
8 { to: '/lazy-css-static', label: '/lazy-css-static' },
9 { to: '/lazy-css-lazy', label: '/lazy-css-lazy' },
10 { to: '/r1', label: '/r1' },
11 { to: '/r2', label: '/r2' },
12 { to: '/shared-a', label: '/shared-a' },
13])
14β
15export function AppShell() {
16 return (
17 <div className={styles.shell}>
18 <nav className={styles.nav}>
19 {ROUTES.map((route) => (
20 <Link key={route.to} {...route} data-testid={`nav-${route.label}`}>
21 {route.label}
22 </Link>
23 ))}
24 </nav>
25β
26 <main className={styles.content}>
27 <div className={styles.rootBadge} data-testid="root-shell-marker">
28 Start manifest CSS root shell
29 </div>
30 <ClientOnly>
31 <div data-testid="hydration-marker">hydrated</div>
32 </ClientOnly>
33 <Outlet />
34 </main>
35 </div>
36 )
37}