3 ms·
<template> (along with <slot>) allows for a declarative shadow DOM instead of clunky attachShadow()s on hidden <div>s (which doesn't work server-side) Otherwis
by cantSpellSober 4y ago
<template> (along with <slot>) allows for a declarative shadow DOM instead of clunky attachShadow()s on hidden <div>s (which doesn't work server-side)
Otherwise you probably don't need <template>, in fact they don't handle events the same as the rest of the DOM and will likely cause more pain
- imaginamundo 4y agoI read an article about it that i liked a lot. https://web.dev/declarative-shadow-dom/ https://web.dev/declarative-shadow-dom/ I even tried to build a library around this, but still don’t know how to finish it hahaha. https://github.com/imaginamundo/webcomponents https://github.com/imaginamundo/webcomponents