after state call back in react setstate code example
Example: react callback set staet
setState( { name: "Michael" }, () => console.log(this.state));// => { name: "Michael" }
setState( { name: "Michael" }, () => console.log(this.state));// => { name: "Michael" }