I am new to React. I have a react component Child like this -
//this.props has obj = {'id': 123, 'name': 'abc'}
class Child extends React.Component{
constructor(props){
super(props);
}
render(){
return(
<div onClick={this.props.remove}></div>
);
}
}
This component is being used from some Parent component which has a list of such Child component, each having their own this.props.obj. this.props.remove is another handler passed to Child from Parent.
Now, on click of div redered from Child component, I want to pass this.props.obj.id in remove function. How can I do that.
Thanks