title: Trying to get the state value after immediate state update
body: <p>I have declared a variable with <code>usestate</code> like as below</p>
  <pre><code>const [currentStepNumber, setCurrentStepNumber] = useState(0);
  </code></pre>
  <p>and then I am updating the state when I click on move function like as below</p>
  <pre><code>const handleMove = () =&gt; {
     setCurrentStepNumber(currentStepNumber + 1);
     const { label } = Object.values(PROJECT_PHASE).find(s =&gt; s.stepNumber === currentStepNumber);
     const projectPhaseID = projectPhaseData.projectPhases.find(a =&gt; a.name === label).id;
     console.log(currentStepNumber);
     // need to do API call as well in move function 
  };
  </code></pre>
  <p>And the <code>currentStepNumber</code> still shows <code>0</code> instead of <code>1</code> only and i cannot use a timer to trigger and update the values. Is there any other approach to achieve this?</p>
  <p>I need to update the <code>currentStepNumber</code> only in move function.</p>