I have three Components. App is the Parent component. Tools and DrawingBoard are child Components. I want to transfer Data between the Tools and DrawingBoard Component.
export default class App extends Component{
getFormData(name, value){
//empty so far
}
render(){
return(
<div className="main-container">
<DrawingBoard styledata={???} />
<Tools data={this.getFormData.bind(this)}/>
</div>
);
}
I pass the function getFormData as a property to Tools to get its data. Now I want to pass name and value, preferably as an associative array or object with arr["name"] = value as a property to DrawingBoard. How can I do that?