react let function run if state is updated code example
Example: react function called last state
this.setState({
someState: obj
}, () => {
this.afterSetStateFinished();
});
this.setState({
someState: obj
}, () => {
this.afterSetStateFinished();
});