Download react-query/examples/react/shadow-dom/src/main.tsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 961 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/examples/react/shadow-dom/src/main.tsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/examples/react/shadow-dom/src/main.tsx
-
curl -L -o main.tsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/examples/react/shadow-dom/src/main.tsx
961 Bytes
| 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) { | |
| 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={appRoot.shadowRoot!} | |
| /> | |
| </QueryClientProvider> | |
| </React.StrictMode>, | |
| ) | |
| } | |