What is the purpose of callback function as an argument of setState() code example
Example: What is the purpose of callback function as an argument of setState()
this.setState({
name:'value'
},() => {
console.log(this.state.name);
});
this.setState({
name:'value'
},() => {
console.log(this.state.name);
});