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

root.tsx

58 lines1.3 KB

1// @refresh reload
2import { Suspense } from 'solid-js'
3import {
4 A,
5 Body,
6 ErrorBoundary,
7 FileRoutes,
8 Head,
9 Html,
10 Meta,
11 Routes,
12 Scripts,
13 Title,
14} from 'solid-start'
15import './root.css'
16​
17import { QueryClient, QueryClientProvider } from '@tanstack/solid-query'
18​
19export default function Root() {
20 const queryClient = new QueryClient({
21 defaultOptions: {
22 queries: {
23 retry: false,
24 },
25 },
26 })
27​
28 return (
29 <Html lang="en">
30 <Head>
31 <Title>SolidStart - Bare</Title>
32 <Meta charset="utf-8" />
33 <Meta name="viewport" content="width=device-width, initial-scale=1" />
34 </Head>
35 <Body>
36 <QueryClientProvider client={queryClient}>
37 <ErrorBoundary>
38 <Suspense
39 fallback={<div>loading... [root.tsx suspense boundary]</div>}
40 >
41 <A href="/">Index</A>
42 <A href="/streamed">Streamed</A>
43 <A href="/deferred">Deferred</A>
44 <A href="/mixed">Mixed</A>
45 <A href="/with-error">With Error</A>
46 <A href="/hydration">Hydration</A>
47​
48 <Routes>
49 <FileRoutes />
50 </Routes>
51 </Suspense>
52 </ErrorBoundary>
53 </QueryClientProvider>
54 <Scripts />
55 </Body>
56 </Html>
57 )