I\'ve been experimenting with React. In my experiement, I\'m using the Reactstrap framework.When I click a button, I\'ve noticed that the HTML form submits. Is there a way t
2 ways
First one we pass the event in the argument right into the onClick.
onTestClick(e) {
e.preventDefault();
alert('here');
}
// Look here we pass the args in the onClick
Second one we pass it into argument and we did right in the onClick
onTestClick() {
alert('here');
}
// Here we did right inside the onClick, but this is the best way
Hope that can help