Is this the most idiomatic way of doing things? The part I'm perplexed by is self.text->set().
import happyx
component InputComponent:
text: State[string]
html:
tDiv:
"Input: "
tInput(type="text", value="{self.text}"):
@input(event):
self.text->set($event.target.value)
var text = remember "Test"
appRoutes("app"):
"/":
component InputComponent(text=text)
It is not a logical step from this for me.
import happyx
var text = remember "Test"
appRoutes("app"):
"/":
tDiv:
"Input: "
tInput(type="text", value="{text}"):
@input(event):
text.set($event.target.value)
I assumed you would want to have self.text.set.
But it is the only way I could come up with that works. Adding an example like this or a better approach to the docs somewhere might be valuable as it took me a lot of trial and error and finally the help of an LLM to reach this point.
Is this the most idiomatic way of doing things? The part I'm perplexed by is
self.text->set().It is not a logical step from this for me.
I assumed you would want to have
self.text.set.But it is the only way I could come up with that works. Adding an example like this or a better approach to the docs somewhere might be valuable as it took me a lot of trial and error and finally the help of an LLM to reach this point.