JSFiddle - React, Tailwind, and code Playground

HTML

<div>
  <textarea>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</textarea>
</div>

CSS

div {
  width: 200px;
  height: 200px;
  background: #fff;
  position: relative;
}

textarea {
  background: transparent;
  border: 0;
  outline: 0;
  text-align: center;
  width: 100%;
  max-width: 100%;
  position: absolute;
}

JavaScript

$(document).ready(function(){

	// função que calcula e aplica a centralização
  function centralizar(){
  	$('textarea').css({ 'height' : '0' }); // reseta a altura para nova contagem
    
  	var textareaSHeight = $('textarea')[0].scrollHeight, // pega o valor do scroll do textarea
    		textareaHeight = $('textarea').height(); // pega o valor da altura do textarea
    
    // verifica se tem scroll ou não
  	if (textareaHeight < textareaSHeight) {
  		var divHeight = $('div').height() / 2, // pega a metade altura da div
  				top = divHeight - (textareaSHeight / 2); // calculo final do valor top
          
      // aplica a altura do textarea e o valor top
    	$('textarea').css({ 'height' : textareaSHeight+'px', 'top' : top+'px' });
    }
 
  }
  
  centralizar(); // aplica o efeito inicial

  // ajuste automático enquanto digitar
  $('textarea').on('keydown', function(){
  	centralizar();
  });
  
});