JSFiddle - React, Tailwind, and code Playground
HTML
<input id="q" />
<br /><br />
<input id="output"/>
JavaScript
$('input#q').keyup( function() {
if( this.value.length < 4 ) return;
/* code to run below */
$('#output').val(this.value);
});