Skip to content

Commit

Permalink
docs: mention xmlns attribute for <svelte:element> (#12598)
Browse files Browse the repository at this point in the history
closes #11993
  • Loading branch information
dummdidumm committed Jul 25, 2024
1 parent 7a8cf3a commit bc78391
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions documentation/docs/02-template-syntax/09-special-elements.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 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
Expand Down

0 comments on commit bc78391

Please sign in to comment.