This commit is contained in:
2026-01-17 01:32:08 +08:00
commit 7706fb2ab2
17 changed files with 1591 additions and 0 deletions

61
src/routes/__root.tsx Normal file
View File

@@ -0,0 +1,61 @@
import { TanStackDevtools } from '@tanstack/react-devtools'
import { ReactQueryDevtoolsPanel } from '@tanstack/react-query-devtools'
import { createRootRoute, HeadContent, Scripts } from '@tanstack/react-router'
import { TanStackRouterDevtoolsPanel } from '@tanstack/react-router-devtools'
import type { ReactNode } from 'react'
import appCss from '@/styles.css?url'
export const Route = createRootRoute({
head: () => ({
meta: [
{
charSet: 'utf-8',
},
{
name: 'viewport',
content: 'width=device-width, initial-scale=1',
},
{
title: 'TanStack Start Starter',
},
],
links: [
{
rel: 'stylesheet',
href: appCss,
},
],
}),
shellComponent: RootDocument,
errorComponent: () => <div>Error</div>,
notFoundComponent: () => <div>404 - Not Found</div>,
})
function RootDocument({ children }: Readonly<{ children: ReactNode }>) {
return (
<html lang="zh-Hans">
<head>
<HeadContent />
</head>
<body>
{children}
<TanStackDevtools
config={{
position: 'bottom-right',
}}
plugins={[
{
name: 'TanStack Router',
render: <TanStackRouterDevtoolsPanel />,
},
{
name: 'TanStack Query',
render: <ReactQueryDevtoolsPanel />,
},
]}
/>
<Scripts />
</body>
</html>
)
}

7
src/routes/index.tsx Normal file
View File

@@ -0,0 +1,7 @@
import { createFileRoute } from '@tanstack/react-router'
export const Route = createFileRoute('/')({ component: App })
function App() {
return <div>Hello, World!</div>
}