this is wrong explanation! Don't post whatever you think. useState does not update cause it's asynchronous it does because a screenshot of the value is saved when setState is called.
@codeWithKB Жыл бұрын
@aniketchoudhary6987 thanks for you valuable comment. So how do we know is the screenshot is update or not, so this is a asynchronous process ji. Below URL might be can help stackoverflow.com/questions/38558200/react-setstate-not-updating-immediately I will go and dig more on this.