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

_nested-layout.tsx

34 lines725 Bytes

1import { Link, Outlet, createFileRoute } from '@tanstack/react-router'
2​
3export const Route = createFileRoute('/_pathlessLayout/_nested-layout')({
4 component: PathlessLayoutComponent,
5})
6​
7function PathlessLayoutComponent() {
8 return (
9 <div>
10 <div>I'm a nested pathless layout</div>
11 <div className="flex gap-2">
12 <Link
13 to="/route-a"
14 activeProps={{
15 className: 'font-bold',
16 }}
17 >
18 Go to route A
19 </Link>
20 <Link
21 to="/route-b"
22 activeProps={{
23 className: 'font-bold',
24 }}
25 >
26 Go to route B
27 </Link>
28 </div>
29 <div>
30 <Outlet />
31 </div>
32 </div>
33 )