code:
setTimeout(() => {
this.setState((state, props) => ({
activateLightColorForRed: true
}), () => {
setTimeout(
this.setState((state, props) => ({
activateLightColorForRed: false
})), 3000);
});
red.play()
}, 3000);
when there's no callback on react setstate it's working but I need to set activateLightColorForYellow to false after 3 seconds. if i use setstate outside setTimeout, setstate is not working. help?