score:0

componentDidMount() {
  fetch('api-endpoint')
    .then(response => response.json())
    .then(result => this.setState({ stateProp: result }))
}

score:1

  componentWillReceiveProps(){         
         this.setState({data:this.props.data});

Related Query

More Query from same tag