JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" />

JavaScript

$("input:text").keyup(function() {
    $(this).css('width', $(this).val().length*10);
});