USE OF COMPONENTDIDMOUNT()
// good place to call setState here
componentDidMount(){
this.setState({
message: 'i got changed',
});
}
---
// or to make request to the server
componentDidMount() {
fetch('https://api.mydomain.com')
.then(response => response.json())
.then(data => this.setState({ message: data.message }));
}