JSFiddle - React, Tailwind, and code Playground

HTML

<textarea name="" id="textarea" cols="30" rows="10"></textarea>

JavaScript

textarea.addEventListener('input', function(e) {
	textarea.value = textarea.value.replace(/(\r\n|\n|\r)/gm, "");
})