preactjs / preact-custom-element

Wrap your component up as a custom element
MIT License
355 stars 52 forks source link

Extend element instead of creating new custom element #78

Open dy opened 1 year ago

dy commented 1 year ago

As in the example

class WordCount extends HTMLParagraphElement {
...
}
customElements.define("word-count", WordCount, { extends: "p" });
<p is="word-count">
  …
</p>

Is there a way to create such component via preact-custom-element?