examples/svelte/shadow-dom
| Name | Last commit message | Last commit date |
|---|---|---|
| .. | ||
README.md
TanStack Svelte Query Shadow DOM Example#
Renders the app and the devtools inside a shadow root.
How it works#
src/lib/services/dogs/queries.tsdefinesdogsQueries.list()withqueryOptions, keyed by['dogs', 'list'], andsrc/lib/services/dogs/api.tsfetches the breed list from the Dog CEO API.src/lib/DogList.sveltereads the breeds withcreateQueryand renders one row per breed.src/main.tsattaches a shadow root to#app, mountssrc/App.svelteinto it and passes the shadow root as a prop.src/App.sveltehands it toSvelteQueryDevtoolsasshadowDOMTarget, so the devtools styles are injected inside the shadow root.
To run this example:
npm installnpm run dev