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

Code Example 1

<button onclick="theCloak();"></button>
function theCloak() {
	document.getElementById("myDiv").style.display="none";
} 
// or...
<button onclick="this.style.display='none';"></button>

Learn ReactJs, React Native from akashmittal.com