examples/react/shadow-dom
| Name | Last commit message | Last commit date |
|---|---|---|
| .. | ||
README.md
TanStack React Query Shadow DOM Example#
Renders the app and the devtools inside a shadow root.
How it works#
src/services/dogs/queries.tsdefinesdogsQueries.list()withqueryOptions, andsrc/services/dogs/api.tsfetches the breed list from the Dog CEO API.src/DogList.tsxreads it withuseQuery(dogsQueries.list())and lists the breed names.src/main.tsxattaches an open shadow root to#root, renders the app into it withQueryClientProvider, and passes the same root toReactQueryDevtoolsasshadowDOMTargetso the devtools styles are injected inside the shadow root.
To run this example:
npm installnpm run dev