@jsx6/jsx6
v1.8.6
Published
JSX and ES6+ UI library
Downloads
363
Readme
JSX6
web components tricks
vanilla JS automatic registration using static initilaizer
class MyCustomElement extends HTMLElement{
static { customElements.define('my-custom-element', this) }
}
or let user define the component and even change the element name
class MyCustomElement extends HTMLElement {
static define(tag='my-custom-element'){ customElements.define(tag, this) }
}
// in that case user must call define before using it
MyCustomElement.define()