Is there any option to do something like this below?
toggle class to a specific element in reactjs
this is function
variable: any
onclick() {
this.variable = 'new value';
}
<img src={ham} className="cursor-pointer" width="40" alt="" onClick={this.handleClick} />
<div className={this.variable + ' cursor-pointer'}>
Content
</div>