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

index.tsx

22 lines521 Bytes

1import { createFileRoute } from '@tanstack/react-router'
2import { Stack, Typography } from '@mui/material'
3import z from 'zod'
4import { Counter } from '~/components/Counter'
5​
6export const Route = createFileRoute('/')({
7 validateSearch: z.object({
8 count: z.number().optional(),
9 }),
10 component: RouteComponent,
11})
12​
13function RouteComponent() {
14 return (
15 <Stack alignItems="center">
16 <Typography variant="h1" marginBlockEnd={4}>
17 Hello world!
18 </Typography>
19 <Counter />
20 </Stack>
21 )