JSFiddle - React, Tailwind, and code Playground
HTML
<form id="f_example">
<textarea id="t1"></textarea>
<textarea id="t2">este tiene un texto muy largo desde que carga la pagina
aksdfasdf
asdfasf
asdf
asdf
asdf
asd
fas
fas
df
asdf
as
fas
fd
y la ultima linea</textarea>
</form>
JavaScript
$('body').on( ' blur change keyup keydown paste cut', 'textarea', function (){
$(this).height(0).height(this.scrollHeight);
}).find( 'textarea' ).change();