Skip to content

Commit 34628b9

Browse files
authored
docs: note custom elements on caveat (#14934)
closes #14727
1 parent 8241096 commit 34628b9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

documentation/docs/07-misc/04-custom-elements.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,4 @@ Custom elements can be a useful way to package components for consumption in a n
125125
- The deprecated `let:` directive has no effect, because custom elements do not have a way to pass data to the parent component that fills the slot
126126
- Polyfills are required to support older browsers
127127
- 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.
128+
- Don't declare properties or attributes starting with `on`, as their usage will be interpreted as an event listener. In other words, Svelte treats `<custom-element oneworld={true}></custom-element>` as `customElement.addEventListener('eworld', true)` (and not as `customElement.oneworld = true`)

0 commit comments

Comments
 (0)