Not able to delete my list from the array, I have also used react update addons but it doesn't not work
My delete function
deleteTips(item){
var array = this.state.newTips;
var index = array.indexOf(item)
array.splice(index, 1);
this.setState({newTips: array });
}
My render function
{ this.state.newTips.map((item, j) => {
const nameVal = "tips" + j
return(
<div style={{width:"8%","float":"right","marginTop":"10px"}}>
<img style={{marginLeft: '10px'}} onClick={this.deleteTips.bind(this, item)}/>
</div>
)
})
}