How can I bind "this" with setState callback. Does react allows it?
this.state = {
selectedId: null,
}
//On click of some list item as
<ListGroup.Item
action href=""
key={id}
onClick={()=>
this.setState({selectedId: id.ID}), () => console.log(this.state.selectedID)
}
>
LIST ITEM
</ListGroup.Item>)