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
exportdefaultclassHeadingComponentextendsHTMLElement{sayHello(){alert(`hello world!`);}connectedCallback(){if(!this.shadowRoot){this.attachShadow({mode: 'open'});this.render();}}render(){return(<buttononclick={this.sayHello}>Get a greeting!</button>)}}customElements.define('wcc-heading',HeadingComponent);
The output I was getting was not including a wrapping <template> tag.
But now with a render function handling all that, will still need that signal, which looks to be in the code, but should probably call this out more explicitly in the JSX section of the docs, since you would be using render instead of shadowRoot.innerHTML now.
Also looks like there was never a test made for this so that probably explains why its not working 😅
The text was updated successfully, but these errors were encountered:
Summary
Noticed that if trying to do something like this
The output I was getting was not including a wrapping
<template>
tag.Details
One thing to call out is that normally the initial HTML is setup from some direct call to
innerHTML
, e.g.But now with a
render
function handling all that, will still need that signal, which looks to be in the code, but should probably call this out more explicitly in the JSX section of the docs, since you would be usingrender
instead ofshadowRoot.innerHTML
now.Also looks like there was never a test made for this so that probably explains why its not working 😅
The text was updated successfully, but these errors were encountered: