title: React state one step behind after set state
body: <p>I have an input field which has an OnChange function handler to update valA. However the console does not log the changed value after I call the setState for valA - it is one step lagged behind</p>
  <p>How can i get it to log the new input?</p>
  <pre><code>function test( props ){
  
  const { valA, setValA } = props
  
  function handleOnChange( e ){
      
      var newValA = e.target.value
      setValA(newValA)
      console.log(valA)
  
      return( null )
  
  }
  return( null )
  
  
  
  }
  </code></pre>