WebReflection / lighterhtml

The hyperHTML strength & experience without its complexity 🎉
https://medium.com/@WebReflection/lit-html-vs-hyperhtml-vs-lighterhtml-c084abfe1285
ISC License
735 stars 20 forks source link

Error setting getter-only property "className" #20

Closed nitely closed 5 years ago

nitely commented 5 years ago

I get this error when setting a dynamic class in a svg element:

import {render, svg} from '//unpkg.com/lighterhtml?module';

const someClass = "foobar" // this is dynamic in the original code, this is just a dummy example

// as automatically rendered wired content 🤯
todo(document.body);
function todo(node, items = []) {
  render(node, () => svg`
  <svg width="200" height="200">
    <text x="20" y="35" class=${someClass}>hello world</text>
  </svg>`);
}
WebReflection commented 5 years ago

it wouldn't have happened in hyperHTML, sorry for the issue, fixed.

nitely commented 5 years ago

Thanks for all your hard work and for bringing sanity to the js world with all the beautiful work you're doing.