File tree Expand file tree Collapse file tree 1 file changed +24
-25
lines changed
examples/react/shadow-dom/src Expand file tree Collapse file tree 1 file changed +24
-25
lines changed Original file line number Diff line number Diff line change @@ -6,30 +6,29 @@ import { ReactQueryDevtools } from '@tanstack/react-query-devtools'
66import { DogList } from './DogList'
77
88const appRoot = document . getElementById ( 'root' )
9+ if ( ! appRoot ) throw new Error ( 'Missing #root element' )
910
10- if ( appRoot ) {
11- const queryClient = new QueryClient ( )
12- const shadowRoot = appRoot . attachShadow ( { mode : 'open' } )
13- const root = ReactDOM . createRoot ( shadowRoot )
11+ const queryClient = new QueryClient ( )
12+ const shadowRoot = appRoot . attachShadow ( { mode : 'open' } )
13+ const root = ReactDOM . createRoot ( shadowRoot )
1414
15- root . render (
16- < React . StrictMode >
17- < QueryClientProvider client = { queryClient } >
18- < div
19- style = { {
20- width : '100vw' ,
21- padding : '30px' ,
22- } }
23- >
24- < h2 > Dog Breeds</ h2 >
25- < DogList />
26- </ div >
27- < ReactQueryDevtools
28- initialIsOpen = { false }
29- buttonPosition = "bottom-left"
30- shadowDOMTarget = { appRoot . shadowRoot ! }
31- />
32- </ QueryClientProvider >
33- </ React . StrictMode > ,
34- )
35- }
15+ root . render (
16+ < React . StrictMode >
17+ < QueryClientProvider client = { queryClient } >
18+ < div
19+ style = { {
20+ width : '100vw' ,
21+ padding : '30px' ,
22+ } }
23+ >
24+ < h2 > Dog Breeds</ h2 >
25+ < DogList />
26+ </ div >
27+ < ReactQueryDevtools
28+ initialIsOpen = { false }
29+ buttonPosition = "bottom-left"
30+ shadowDOMTarget = { shadowRoot }
31+ />
32+ </ QueryClientProvider >
33+ </ React . StrictMode > ,
34+ )
You can’t perform that action at this time.
0 commit comments