If you need to send a custom parameter to your onClick event handler, do like this
if you need to pass the event as well to the onClick handler use like this
and in your tabClicked() you can get the parameters like this
<a href="" onClick={()=> {this.tabClicked("Exceptions")}}>Exceptions</a>
<a href="" onClick={(evt)=> {this.tabClicked(evt,"Exceptions")}}>Exceptions</a>
tabClicked(evt, tab) {
evt.preventDefault(); // Let's stop this event.
alert(tab); // should alert Exceptions
}
No comments:
Post a Comment