Web components don't need a constructor() | Go Make Things
For years, I’ve written my web component classes with a constructor() method that calls super() to get access to the parent HTMLElement class’s properties…
customElements.define('my-awesome-web-component', class extends HTMLElement { constructor () { // Inherit properties super(); // The rest of your code... } }); For my demo projects, I often do all the things in the constructor().
But with Kelp, my UI library for people who love HTML, I’m initializing my in the connectedCallback() method.