title: OnChange form validation react
body: <p>I encounter a problem with my form validation in react that I don't know how to resolve, here he's :</p>
  
  <p>I want to check if two inputs are same, for example if two mail input are equal to check if the user didn't misspelled his mail but I want a dynamic validation, when the user is writing, check meanwhile.</p>
  
  <p>There is my code :</p>
  
  <p><a href="https://codesandbox.io/s/1v4xxqjzo3" rel="nofollow noreferrer">https://codesandbox.io/s/1v4xxqjzo3</a></p>
  
  <p>Open the console and start writing in input, and you will see in the OnChange function that both state are never equal because it's like the Onchange function is updating not enough fast, but if I put a setTimeout , it will work because the states are complete.</p>