2 ms·
One thing nice about React is that it can take care of quoting for you depending on the method call the jsx template translates into (attribute, value, element
by ec109685 7y ago
One thing nice about React is that it can take care of quoting for you depending on the method call the jsx template translates into (attribute, value, element name). String templates doesn’t have that nice property.
- spankalee 7y agoCan you explain that more? I'm not sure what you're saying is true with lit-html. You don't have to quote attributes with single expressions. html`<div class=${myClass}></div>` is perfectly fine.
- ec109685 7y agoAh, thanks for pointing that out.
- arthurdenture 7y agolit-html is context-aware and safe, just like JSX. It's not a raw string templating library. https://lit-html.polymer-project.org/guide/template-reference#unsafehtml https://lit-html.polymer-project.org/guide/template-referenc...