Skip to content

Instantly share code, notes, and snippets.

@web-padawan
Created November 10, 2020 14:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save web-padawan/c824dc3a2064517ceb942b154e7bb1c7 to your computer and use it in GitHub Desktop.
Save web-padawan/c824dc3a2064517ceb942b154e7bb1c7 to your computer and use it in GitHub Desktop.
class MyElement extends HTMLElement {
connectedCallback(): void {
this.textContent = 'Hello';
}
}
customElements.define('my-element', MyElement);
declare global {
interface HTMLElementTagNameMap {
'my-element': MyElement;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment