Check out example codes for "check if gameobject is active". It will help you in understanding the concepts better.

Code Example 1

if (gameObject.activeSelf)
{
	// this happens when object is active
}

Code Example 2

// To check if a GameObject is active:
gameObject.activeSelf;

Learn ReactJs, React Native from akashmittal.com