Check out example codes for "textarea scale to content". It will help you in understanding the concepts better.

Code Example 1

<textarea rows="10" style="font-size: 2vw; width:100%;">

Learn ReactJs, React Native from akashmittal.com