golive
golive copied to clipboard
Click event not firing server side
Hello! I'm new to GoLive but I'm really excited about this project! I've ran the examples and I've tried to create my own from the start to get familiar but I'm struggling to get a simple button click event to fire on the server side.
I have the following HTML:
<button go-live-click="HandleUp">+</button>
And on the server I have this but the Println()
doesn't seem to fire.
func (t *Thermostat) HandleUp() {
fmt.Println("UP")
t.Temperature = 50
}
I would really appreciate any help!
Hi! Thank you opening this issue! I had to iterate again and it took me a bit of time. One of the first things I would say for you to be aware of is that the component needs to have a single dom element at the root of the render. If this is not the problem, could you provide me with a repository with the reproduction?
That was the issue! Thank you so much for replying. Is there any way golive could give me an informative error I could have discovered how to fix this myself? The silent brokenness I had no idea what I needed to fix.
Surely the library could warn this at runtime. I've been working lately on a version to support composition and will already add this warning on first run
Thank you very much for the feedback!!