2 ms·
If you wanted to, with WebComponents you could easily use an x-PageFoo tag as a parent tag that orchestrates other child components. Your WebComponent is just a
by ehnto 9y ago
If you wanted to, with WebComponents you could easily use an x-PageFoo tag as a parent tag that orchestrates other child components. Your WebComponent is just a bunch of HTML, Javascript and CSS, it can really do what ever you want it to. It isn't a framework though, so to suggest that it doesn't provide as much as React is being a bit disingenuous, as it's not trying to. It's trying to formalise some of the foundations for things like react.
Smaller scale but for fun, in vanilla WebComponents (as implemented in Chrome) I put together a Slider that can then accept and consume child elements that add behaviour, like this:
<x-slider data-config="{autoplay:true}">
<img src="some.jpg" />
<img src="some.jpg" />
<x-slider-controls /> //Introduces left and right slider controls
<x-slider-dots /> //Introduces slider dots
</x-slider>