I am writing a table application using RiotJS and I keep running into the same problem with the onclick event. Almost every time I try to use the
<tag onclick={somefunction}>
I get very erratic behaviour. Sometimes it will call the function a whole bunch of times as the page loads or updates, and then not respond to clicks at all, other times it will triggered several times at launch. I can't seem to figure out a pattern behind the problem, although I have noticed that it tends to be a problem with in line function calls e.g.
<tag onclick={console.log("foo")}>
and less often with reference passing <tag onclick={function}>
although it happens with both. Has anybody experienced anything like this? Please comment if you need more context.