Friday, 7 April 2017

React his.setState is not a function

This is parent Element :

  changedData(){
    this.setState({
      changed: true
    }).bind(this)
  }

I'm passing it to the child:

<AboutMe  changedData={this.changedData} auth={this.props.auth} profile={profile}/>  

The child:

  dataChanged(data) {
            this.props.changedData();    
      console.log("dataChanged!!")

  }



via Elena Volskaia

No comments:

Post a Comment