3 ms·
Not entirely true - you get things like shadow dom with them - which means "proper" encapsulation.
by ergo14 9y ago
Not entirely true - you get things like shadow dom with them - which means "proper" encapsulation.
- floatboth 9y agoAnd custom elements provide a way to actually create, well, your own DOM elements. Libraries like React provide their own "fake" components that are only usable from within the libraries. With Custom Elements you can actually provide a DOM API for your element, that can be used from plain JS. And HTML Imports provide deduplication. They're a solution to the "I have four copies of jQuery on my page" problem.