From 603d6ba9150b85fe8813e82f3ad219faf5b5009b Mon Sep 17 00:00:00 2001 From: paoloricciuti Date: Mon, 26 May 2025 11:46:21 +0200 Subject: [PATCH] docs: add note to custom element docs --- documentation/docs/07-misc/04-custom-elements.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/documentation/docs/07-misc/04-custom-elements.md b/documentation/docs/07-misc/04-custom-elements.md index a8e0c81763..8dbcdd25a3 100644 --- a/documentation/docs/07-misc/04-custom-elements.md +++ b/documentation/docs/07-misc/04-custom-elements.md @@ -114,6 +114,8 @@ When constructing a custom element, you can tailor several aspects by defining ` ... ``` +> [!NOTE] While Typescript is supported in the `extend` function is subject to the same limitations of the script tags: you need to set `lang="ts"` on one of the scripts AND you can only use [erasable syntax](https://www.typescriptlang.org/tsconfig/#erasableSyntaxOnly) in it. + ## Caveats and limitations Custom elements can be a useful way to package components for consumption in a non-Svelte app, as they will work with vanilla HTML and JavaScript as well as [most frameworks](https://custom-elements-everywhere.com/). There are, however, some important differences to be aware of: