This is because you are actually calling the console.log function in the onClick handler, and not just pointing to its link. JSX compiles to regular JS, so a comparison will be made between the brackets {} . You just need to point to the function link in your onClick and not call it.
This is a little complicated by the fact that when using ES6 classes you need to bind to the current this , it is not autonomous for you using the old-style syntax React.createClass , but here is a quick example,
class MyComponent { onLinkClicked () { console.log('Clicked!') } render () { return ( <a onClick={this.onLinkClicked.bind(this)}>Click me</a> ); } }
source share