Closed nitely closed 5 years ago
you have a typo in your code ... you cannot close </g>
there, and you also don't need svg
to create <svg>
nodes, 'cause those are created out of HTML.
import {render, html, svg} from '//unpkg.com/lighterhtml?module';
const someClass = "foobar"
todo(document.body);
function todo(node, items = []) {
let texts = ['a', 'b']
const child = () => html`
<svg width="200" height="200">
<g class="foo">
${texts.map((t, i) => svg`
<rect x=${20 * i} y="35" width=10 height=10 class=${t}></rect>
`)}
</g>
</svg>`
render(node, child)
}
does it work now?
Sorry about that. No, still, same error. The original code had no typo.
Edit: Ah, seems like you fixed it. Thanks!
mind checking if using https://raw.githubusercontent.com/WebReflection/lighterhtml/master/index.js
and const {render, html, svg} = lighterhtml
would work?
I get this error when setting a dynamic class in children elements: