State changes asynchronously
constructor(props) {
super(props);
this.state = { name: 'name' };
this.setState({
name: 'newName'
});
console.log(this.state.name);
}
// name
constructor(props) {
super(props);
this.state = { name: 'name' };
this.setState({
name: 'newName'
});
console.log(this.state.name);
}
// name