From a7abf8d8fa41d9b7794e2639460ab3d98705530c Mon Sep 17 00:00:00 2001 From: Github11200 Date: Thu, 28 Aug 2025 14:38:31 -0700 Subject: [PATCH] Updated the custom elements documentation to include --- documentation/docs/07-misc/04-custom-elements.md | 1 + 1 file changed, 1 insertion(+) diff --git a/documentation/docs/07-misc/04-custom-elements.md b/documentation/docs/07-misc/04-custom-elements.md index 7e6a17b947..deb1c4d8bf 100644 --- a/documentation/docs/07-misc/04-custom-elements.md +++ b/documentation/docs/07-misc/04-custom-elements.md @@ -128,3 +128,4 @@ Custom elements can be a useful way to package components for consumption in a n - Polyfills are required to support older browsers - You can use Svelte's context feature between regular Svelte components within a custom element, but you can't use them across custom elements. In other words, you can't use `setContext` on a parent custom element and read that with `getContext` in a child custom element. - Don't declare properties or attributes starting with `on`, as their usage will be interpreted as an event listener. In other words, Svelte treats `` as `customElement.addEventListener('eworld', true)` (and not as `customElement.oneworld = true`) +- If you would like to dispatch custom events or just access the host element then you can use the [\$host](https://svelte.dev/docs/svelte/$host) rune.