forked from TanStack/query
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.tsx
More file actions
34 lines (31 loc) · 944 Bytes
/
main.tsx
File metadata and controls
34 lines (31 loc) · 944 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import React from 'react'
import ReactDOM from 'react-dom/client'
import './index.css'
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { ReactQueryDevtools } from '@tanstack/react-query-devtools'
import { DogList } from './DogList'
const appRoot = document.getElementById('root')
if (!appRoot) throw new Error('Missing #root element')
const queryClient = new QueryClient()
const shadowRoot = appRoot.attachShadow({ mode: 'open' })
const root = ReactDOM.createRoot(shadowRoot)
root.render(
<React.StrictMode>
<QueryClientProvider client={queryClient}>
<div
style={{
width: '100vw',
padding: '30px',
}}
>
<h2>Dog Breeds</h2>
<DogList />
</div>
<ReactQueryDevtools
initialIsOpen={false}
buttonPosition="bottom-left"
shadowDOMTarget={shadowRoot}
/>
</QueryClientProvider>
</React.StrictMode>,
)