Check out example codes for "onclick url". It will help you in understanding the concepts better.

Code Example 1

<button onclick="location.href='logout.php';">logout</button>

Learn ReactJs, React Native from akashmittal.com