JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text"></input>

JavaScript

$("input").on("keypress", function () {
  setTimeout(function () {
    alert("new value should have been already added to text field. Now we are executing some custom stuff");
  }, 1000);
  return true;
});