This in React


#1

Can someone please explain the difference between using.

 constructor(props){
    super(props);
    this.state = {
      color: green
    }
   this.changeColor = this .changeColor.bind(this);
  }

AND


 //button onClick={this.changeColor.bind(this)}
          Change color
       // /button

Thanks.


#2

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.