JSFiddle - React, Tailwind, and code Playground

HTML

<textarea></textarea>

JavaScript

$('textarea').on('input', function(){
	$(this).height( 'auto' ).height( $(this)[0].scrollHeight );
});