I am updating the state of the react state. Immediately after calling "setState" method, I am calling another method that use the updated state value. But as
this.setState takes some time to update the value state value. I am accessing the same state in the function called instead of the updated one. So, I tired to set a promise to
setState method so that I can specify a callback when the state is updated. So, how to do it ? any help ?