Check out example codes for "set width of rect transform unity". It will help you in understanding the concepts better.

Code Example 1

rectTransform.sizeDelta = new Vector2(50, 50);

Learn ReactJs, React Native from akashmittal.com