code inside setstate callback 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" }