I am trying to distinguish between left and right clicks in an OnClick function. But,
var r = React.createClass({
handleClick : function(e){
//left click
if(e.which==1){
//Do something
}
},
render : function(){
return <p onClick={this.handleClick}>Something </p>
}
});
Turns out e.which is undefined for Synthetic Events. How can I distinguish between left and right clicks here?
See Question&Answers more detail:os