I know how it can be done with onClick, for adding a new css class for example:
wheelFade = (event) => {
event.target.classList.add('newClass');
}
render(){
return(
<img onClick={this.wheelFade} className="wheel1" src="wheel.png" alt=""/>
)
}
But if I want to add a class to the img tag using a setTimtOut for example how can I access the img tag without having the event.target that I do get on click?
Thanks in advance