How to add delay in React.js?

Pure typescript Solution

You would be able to create delay function with async:

function timeout(delay: number) {
    return new Promise( res => setTimeout(res, delay) );
}

And then call the function:

await timeout(1000); //for 1 sec delay

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)