Check out example codes for "javascript prevent form submit". It will help you in understanding the concepts better.

Code Example 1

<button type="submit" onclick="submitButtonClick(event)">Submit</button>
<script>
function submitButtonClick(event) {
		event.preventDefault();
		//other stuff you want to do instead...
} 
</script>

Code Example 2

<form name="foo" onsubmit="return false">

Learn ReactJs, React Native from akashmittal.com