JSFiddle - React, Tailwind, and code Playground

HTML

<textarea></textarea>

JavaScript

$('textarea').keypress(function () {
    var length = $(this).val().length;
    if (length % 51 == 0 &&
       length > 0) {
        var val = $(this).val();
        $(this).val(val + '\n');
    }
});