title: get image size before upload in React
body: <p>The desired results have been done in vanilla <a href="https://stackoverflow.com/questions/8903854/check-image-width-and-height-before-upload-with-javascript">here</a> </p>
  
  <p>To be clear, I won't be using <code>alert()</code>, I'd like to place the dimensions in the <code>state</code> object.</p>
  
  <p>How would I recreate this code in React under the <code>OnChange()</code> event handler?</p>
  
  <hr>
  
  <p><a href="https://i.stack.imgur.com/L1bzo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/L1bzo.png" alt="enter image description here"></a></p>