Check out example codes for "unity how to change text in script". It will help you in understanding the concepts better.

Code Example 1

Text myText = GameObject.Find("Canvas/Text").GetComponent<Text>();
myText.text = "Your text changed!";

Code Example 2

// To change text of a text UI element use th combination below
textGameObject.GetComponent<UnityEngine.UI.Text>().text = "text";

Learn ReactJs, React Native from