Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Define a web component inside another web component without polluting global namespace

Suppose I want to use a web component that use 10 web component internally, and if the component define it globally, Internals will pollute my global component namespace and I can't use their name for another components.

Is there any way to use a web component inside another web component without defining it via customElements.define()?

like image 231
hamid k Avatar asked Sep 16 '26 23:09

hamid k


1 Answers

There is some discussion around creating scoped custom element registries but nothing has a spec or been implemented yet.

like image 81
abraham Avatar answered Sep 18 '26 11:09

abraham



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!