I am learning React JS and as of now I cannot find any example on the source code, tests or on the official docs. On the docs the touchStart
event is said to be supported but handleTouchStart
does not work.
The only place I found and example that actually works was on react-touch project.
The following code works, but is this the only way of binding? It looks like a cheap workaround for me.
var MyHeader = React.createClass({
handleTouchStart: function() {
console.log('handleTouchStart');
},
render: function() {
return this.transferPropsTo(
<header onTouchStart={this.handleTouchStart}>{title}</header>
);
}
};
What is actually the proper way of doing this?