I want that when the user clicks on this button, it will be disable for a period of time and then it will enable automatically
>Solution :
const [disable, setDisable] = useState(false);
const handleDisable = () => {
setDisable(true);
setTimeout(() => {setDisable(false)}, 3000)
}
<button disabled={disable} onClick={handleDisable}>click me</Button>