I have a a react Parent component which having a child component.
import Child from './child';
export default class Parent extends Component {
constructor(props){
super(props);
this.state = {
events: [
{
title: "My event",
start: new Date(2019, 4, 27, 7, 0), // 10.00 AM
end: new Date(2019, 4, 27, 14, 0) // 2.00 PM
}
],
}
}
render() {
return (
<div>
<h1>Parent component</h1>
<Child events={this.state.events}/>
</div>);
}
and on the Child component, I want to update this events and send it to Parent component.
How can I fix it ?