Skip to content

Commit bc78391

Browse files
authored
docs: mention xmlns attribute for <svelte:element> (#12598)
closes #11993
1 parent 7a8cf3a commit bc78391

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

documentation/docs/02-template-syntax/09-special-elements.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ If `this` is the name of a [void element](https://developer.mozilla.org/en-US/do
6464
<svelte:element this={tag} on:click={handler}>Foo</svelte:element>
6565
```
6666

67+
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:
68+
69+
```svelte
70+
<svelte:element this={tag} xmlns="http://www.w3.org/2000/svg" />
71+
```
72+
6773
## `<svelte:window>`
6874

6975
```svelte

0 commit comments

Comments
 (0)