I'm trying to write a simple code with a setTimeout
, but the setTimeout
just won't wait the time it's supposes to and the code execute immediately. What am I doing wrong?
setTimeout(testfunction(), 2000);
question from:https://stackoverflow.com/questions/65906112/setinterval-in-this-react-code-doesnt-work-i-just-get-time-once