JSFiddle - React, Tailwind, and code Playground

HTML

<textarea rows="1"></textarea>

<div class="r"></div>

JavaScript

$("textarea").keypress(function(e){
var r = $(this).attr('rows');
if (e.keyCode === 13)
{
    r++;
      $('.r').text('количество строк - ' + r);
$(this).attr('rows',r);
}	

});