JSFiddle - React, Tailwind, and code Playground

HTML

<input type='button' onmousedown='if (!this.timer) this.timer=setTimeout(function(){alert("3 секунды прошло");}, 3000);' onmouseup='clearTimeout(this.timer);this.timer=null;' value='Нажать' />