Open History to see the last commit
1# TanStack React Query Shadow DOM Example
2β
3Renders the app and the devtools inside a shadow root.
4β
5## How it works
6β
7- `src/services/dogs/queries.ts` defines `dogsQueries.list()` with `queryOptions`, and `src/services/dogs/api.ts` fetches the breed list from the Dog CEO API.
8- `src/DogList.tsx` reads it with `useQuery(dogsQueries.list())` and lists the breed names.
9- `src/main.tsx` attaches an open shadow root to `#root`, renders the app into it with `QueryClientProvider`, and passes the same root to `ReactQueryDevtools` as `shadowDOMTarget` so the devtools styles are injected inside the shadow root.
10β
11To run this example:
12β
13- `npm install`
14- `npm run dev`