2 ms·
I like that this illustrates how easy it is to make a web component. What I don't like is this also shows (via the render method) how you can foot gun yourself
by no_wizard 6y ago
I like that this illustrates how easy it is to make a web component.
What I don't like is this also shows (via the render method) how you can foot gun yourself if you aren't careful. Just slabbing in everything via `this.innerHTML` will lead to gross performance problems, among other things. There's also no real diffing (only matters on more complex concerns, in a way) so you're replacing everything just to update the count.
I know we're all suppose to know better (I doubt you did this except for the express purpose of showing just how simple the Web Component API can be), but I've seen example code end up in production more times than I can count, from all over the web, so be forewarned stewards!