Check out example codes for "prevent form submit on page refresh php\". It will help you in understanding the concepts better.

Code Example 1

//Using Javascript
<script>
if ( window.history.replaceState ) {
        window.history.replaceState( null, null, window.location.href );
    }
</script>

Learn ReactJs, React Native from akashmittal.com