Check out example codes for "unity delete all children". It will help you in understanding the concepts better.

Code Example 1

foreach (Transform child in transform) {
     Destroy(child.gameObject);
 }

Code Example 2

foreach (Transform child in TextHolder.transform) {     GameObject.Destroy(child.gameObject); }

Learn ReactJs, React Native from akashmittal.com