3 ms·
> What could be done is to have the component function return a closure that returns the VDOM nodes instead of the VDOM nodes themselves, and then the hooks wou
by jcelerier 6y ago
> What could be done is to have the component function return a closure that returns the VDOM nodes instead of the VDOM nodes themselves, and then the hooks would be run only once, since rerendering would only run the returned closure and not the whole component function, and there would be no need for the magic or rules.
what could be done is actually using a proper reactive language where things look like this, instead of hacking HTML, JS and whatnot in an unholy mess of syntax:
Button {
text: "Show menu"
onClicked: menu.visible = !menu.visible
}
Menu {
id: menu
}
e.g. a bit like this: https://tinyurl.com/yaawdomh https://tinyurl.com/yaawdomh