docs: mention xmlns attribute for `<svelte:element>` (#12598)

closes #11993
pull/12599/head
Simon H 2 months ago committed by GitHub
parent 7a8cf3a9a1
commit bc78391bdc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -64,6 +64,12 @@ If `this` is the name of a [void element](https://developer.mozilla.org/en-US/do
<svelte:element this={tag} on:click={handler}>Foo</svelte:element> <svelte:element this={tag} on:click={handler}>Foo</svelte:element>
``` ```
Svelte tries its best to infer the correct namespace from its surroundings, but that's not always possible to analyze statically. You can give a hint by adding a `xmlns` attribute:
```svelte
<svelte:element this={tag} xmlns="http://www.w3.org/2000/svg" />
```
## `<svelte:window>` ## `<svelte:window>`
```svelte ```svelte

Loading…
Cancel
Save