Check out example codes for "how to make a button turn on and off and object unity". It will help you in understanding the concepts better.

Code Example 1

public GameObject Obj;
bool YesNo = false;

void start() 
{
	Obj.SetActive(false);
}

public void Button()
{
	if(YesNo == true)
	{
		Obj.SetActive(false);
		YesNo = false;
	}
	else if(YesNo == false)
	{
		Obj.SetActive(true);
		YesNo = true;
	}
}

Learn ReactJs, React Native from akashmittal.com