DEV Community

Discussion on: Web component - learnings and limitations

Collapse
 
dannyengelman profile image
Danny Engelman

it is "closed", not "close"

And all it does is prevent access to .shadowRoot, and that is all it does.

Nothing stops you (the WC Author) from exposing your component to the outside world.

Thread Thread
 
akdevcraft profile image
AK DevCraft

This is really awesome, I didn't find an example this like. My requirement was to expose certain HTML element inside the web component, that now I can easily expose as a simple function. Going back to your example, I can add a function like below

getButtonEle(){
              return this.root.children[1];
          }
Enter fullscreen mode Exit fullscreen mode

Thank you!