You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is documented here in this comment from another PR: #64 (comment). document.createElement should run the component's constructor method.
classCounterPreactextendsComponent{constructor(){super()console.log('here')}}register(CounterPreact,'x-counter-preact')// ...document.createElement('x-counter-preact')// no output
classCounterPlainextendsHTMLElement{constructor(){super()console.log('here')}}customElements.define('x-counter-plain',CounterPlain)// ...document.createElement('x-counter-plain')// outputs here
The constructor only seems to fire when the custom element as appended to the DOM.