JSFiddle - React, Tailwind, and code Playground

by bairog

HTML

<textarea rows="5", cols="40", oninput="auto_grow(this)"></textarea>

JavaScript

function auto_grow(element) {
    if (element.scrollHeight > 80) { 
		element.style.height = 5 + "px"; element.style.height = element.scrollHeight + "px"; 
		}
}