|
|
|
|
|
by dtagames
1514 days ago
|
|
I use Lit every day and I have no idea what you're talking about. Any property can be a full JS object. When the property is changed, it is re-rendered in your component. I have never touched innerHtml and my Lit apps pass and render all kinds of stuff into html`` tagged templates. It's really pure magic because you can freely mix regular old HTML and regular attributes with dynamic data and data binding. There's more than one way to write anything which gives you great flexibility. I adore tagged templates, and they work for CSS and SVG, too. |
|
I'm talking about how lit is implemented internally and that's why I provided links to relevant parts of lit's code.
People having no idea how things work is the bane of our industry. And that's why we have objectively false statements like "regular old HTML and regular attributes with dynamic data and data binding".
Lit is almost as far from "regular old HTML" as React's JSX is: lit is a HTML-like DSL that even has constraints on how you use tagged literals themselves.
E.g. `<${tagName}></${tagName}>` is a valid tagged literal and it's invalid in lit.[1]
> they work for CSS and SVG, too.
If lit lets you mix SVG with custom elements, they don't really use custom elements. See discussion https://twitter.com/Rich_Harris/status/1198339672361119745?s...
[1] https://lit.dev/docs/templates/expressions/#invalid-location...