mirror of
https://github.com/Dokploy/examples.git
synced 2026-06-27 01:55:26 +02:00
feat(tanstack): initialize TanStack project with routing, API, and error handling components
This commit is contained in:
34
tanstack/src/routes/_pathlessLayout/_nested-layout.tsx
Normal file
34
tanstack/src/routes/_pathlessLayout/_nested-layout.tsx
Normal file
@@ -0,0 +1,34 @@
|
||||
import { Link, Outlet, createFileRoute } from '@tanstack/react-router'
|
||||
|
||||
export const Route = createFileRoute('/_pathlessLayout/_nested-layout')({
|
||||
component: LayoutComponent,
|
||||
})
|
||||
|
||||
function LayoutComponent() {
|
||||
return (
|
||||
<div>
|
||||
<div>I'm a nested layout</div>
|
||||
<div className="flex gap-2 border-b">
|
||||
<Link
|
||||
to="/route-a"
|
||||
activeProps={{
|
||||
className: 'font-bold',
|
||||
}}
|
||||
>
|
||||
Go to route A
|
||||
</Link>
|
||||
<Link
|
||||
to="/route-b"
|
||||
activeProps={{
|
||||
className: 'font-bold',
|
||||
}}
|
||||
>
|
||||
Go to route B
|
||||
</Link>
|
||||
</div>
|
||||
<div>
|
||||
<Outlet />
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
import { createFileRoute } from '@tanstack/react-router'
|
||||
|
||||
export const Route = createFileRoute('/_pathlessLayout/_nested-layout/route-a')(
|
||||
{
|
||||
component: LayoutAComponent,
|
||||
},
|
||||
)
|
||||
|
||||
function LayoutAComponent() {
|
||||
return <div>I'm A!</div>
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
import { createFileRoute } from '@tanstack/react-router'
|
||||
|
||||
export const Route = createFileRoute('/_pathlessLayout/_nested-layout/route-b')(
|
||||
{
|
||||
component: LayoutBComponent,
|
||||
},
|
||||
)
|
||||
|
||||
function LayoutBComponent() {
|
||||
return <div>I'm B!</div>
|
||||
}
|
||||
Reference in New Issue
Block a user