Check out example codes for "to hide or show a canvas in unity". It will help you in understanding the concepts better.
Code Example 1
CanvasA.gameObject.SetActive(false); CanvasB.gameObject.SetActive(true);
Learn ReactJs, React Native from akashmittal.com