I have a array of div elements as follows:-
var accdata = [];
for(var i = 0;i < returndata1.length;++i){
accdata.push(
<div className="data-main" onMouseEnter={this.toggleHover} onMouseLeave={this.toggleHover}>
<span className="data-child">{returndata1[i].Project}</span>
<span className={this.state.cls}>
<span className="flag"></span>
<span className="share"></span>
<span className="star"></span>
</span>
</div>
);
}
//toggle function
toggleHover(){
this.setState({hover: !this.state.hover})
if(this.state.hover === true){
this.setState({cls: 'icon-display'})
}
else{
this.setState({cls: ''})
}
}
but on mouseover the span element of all the divisions disappears. how can I set like if we mouseover a particular row only the span element of that row disappears?