shade
shade copied to clipboard
Sharp corner: Attribute state in tag subcomponents
E.g.:
var foo by observable(false)
button {
classes = setOf("foo")
render {
if(foo){
classes = classes + "bar"
}
}
onClick { foo = true }
}
Since enclosing tags are synthetically created fresh on component re-render, the button's classes would end up as just "bar" after the button's click. We may be able to warn users when they access attribute values of a tag.