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

README.md

14 lines662 Bytes

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`