react set componente state once code example
Example: react function called last state
this.setState({
someState: obj
}, () => {
this.afterSetStateFinished();
});
this.setState({
someState: obj
}, () => {
this.afterSetStateFinished();
});