title: console log the state after using useState doesn't return the current value
body: <p>using <code>console.log()</code> after using reactjs <code>useState()</code> hook, doesn't return the current value of this state, How can I handle this?</p>
  
  <p>Here's code for the case, try to figure out what's the console log display.</p>
  
  <pre class="lang-js prettyprint-override"><code>import React, { useState } from "react";
  import ReactDOM from "react-dom";
  
  function Weather() {
    const [weather, setWeather] = useState();
  
    return (
      &lt;input
        value={weather}
        onChange={(e) =&gt; {
          setWeather(e.target.value);
          console.log(weather);
        }}
      /&gt;
    );
  }
  
  const rootElement = document.getElementById("root");
  ReactDOM.render(&lt;Weather /&gt;, rootElement);
  </code></pre>