3 ms·
> But seriously I can't use `<SomeThing onClick={this.handleClick}/>`? That's what you get by shoehorning XML. Here's how you do it: var someThing = docume
by z3t4 10y ago
> But seriously I can't use `<SomeThing onClick={this.handleClick}/>`?
That's what you get by shoehorning XML. Here's how you do it:
var someThing = document.createElement("button");
someThing.onclick = handleClick;
HTML is a fun an powerful language, but it should only be used for static web pages or old school server rendering.
- terragon 10y agoYou can also use <SomeThing onClick={() => this.handleClick()} />