I want my code to wait 500 milliseconds before performing the next step.
I've used setTimeout
but it doesn't work.
updateDisplay = arr => {
setTimeout(function () {
this.setState({ sortArray: arr });
}, 500);
};
I want my code to wait 500 milliseconds before performing the next step.
I've used setTimeout
but it doesn't work.
updateDisplay = arr => {
setTimeout(function () {
this.setState({ sortArray: arr });
}, 500);
};
Some simple incorrect syntax.
updateDisplay = (arr) => {
setTimeout(() => this.setState({ sortArray: arr }), 500);
};