Open History to see the last commit
TanStack Preact Query Shadow DOM Example#
Renders the app and the devtools inside a shadow root.
How it works#
src/services/dogs/queries.tsdefinesdogsQueries.list(), aqueryOptionsfactory keyed by['dogs', 'list']that fetches the breed list from the Dog CEO API.src/DogList.tsxpasses it touseQueryand lists the breed names.src/index.tsxcreates a shadow root withattachShadow, rendersQueryClientProviderinto it, and passes the shadow root toPreactQueryDevtoolsasshadowDOMTargetso the devtools styles are added inside it.
To run this example:
npm installnpm run dev