1class SomeComponent extends Component{
2
3 constructor(props){
4 super(props);
5 //does whatever stuff
6 this.myFunction = this.myFunction.bind(this);
7
8 }
9
10 //(only applicable to raw and normal forms)
11 myFunction(param){
12 console.log('do something: ', param);
13 }
14
15 render(){
16 return (<div><ChildComponent1 myFunction={this.myFunction}/></div>)
17 }
18}
19
20class ChildComponent1{
21 render(){
22 return (<div><ChildComponent2 myFunction={this.props.myFunction}/></div>)
23 }
24}
25
26class ChildComponent2{
27 render(){
28 return (<Button onClick={()=>this.props.myFunction(param)}>SomeButton</Button>)
29 }
30}