0

there is this thread that I tought it was my solution. Basically what I want to do is to send multiple function inside one that is sent over an onClick callback. The console returns an error saying that my functions inside wrapper function are not defined.

This is my code:

function1(){
 this.setState({
      ...
 });
}
function2(){
 ...
}
mainFunction(e){
 function1();
 function2();
}

<Component2 clickHandler={this.mainFunction}/>

I also bind the functions in my constructor method just in case. When I fire the event clicking in my second component i get return that function1 is not defined. Any ideas?

Emmanuel
  • 2,957
  • 3
  • 14
  • 17

0 Answers0