JSFiddle - React, Tailwind, and code Playground
HTML
<form action="#" method="get">
<textarea name="text">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</textarea><br/>
<input type="text" name="input1"/><br/>
<input type="text" name="input2"/>
</form>
CSS
textarea {border:solid 1px red; width:200px; height:50px; }
JavaScript
$('form').on('click', '*', function(){
if(this.nodeName === "TEXTAREA") {
var hght = this.scrollHeight;
$(this).css({'height':hght + 'px'})
}
else {
$('textarea').attr('style', '');
}
})