JSFiddle - React, Tailwind, and code Playground

HTML

<textarea class="texty"></textarea>

CSS

.texty {
    width: 400px;
    height: 300px;
}

JavaScript

$(document).ready(function () {
    $(".texty").bind("keydown", function (e) {
        if (e.which == 13) {
            // User entered a newline.
            // Start the line with the phrase "I am"
            $('.texty').val($('.texty').val() + '\nI am');
            e.preventDefault();
        }
    });
});