Svelte · Middle · Question 31 of 75
How do you build a Svelte component as a custom element?
<svelte:options customElement="my-counter" />- ✓Correct answer: Set
customElementin<svelte:options>and compile with thecustomElementcompiler option - 2Wrap it in
<web-component> - 3Svelte can't produce custom elements
Explanation
Inside, $host() gives access to the host element, e.g. to dispatch events.