title: useState set returning empty object
body: <p>My component code does something like this:</p>
  <pre><code>const [imageMap, setImageMap] = useState([]);
  
  //...
  
  useEffect(async () =&gt; {
          const x = await getList();
          setImageMap(x);
  }, []);
  
  console.log(imageMap);
  </code></pre>
  <p>The <code>console.log</code> works fine and prints the list that returned from the function <code>getList()</code> (which is a promise and takes a while to finish, since it retrieves data from the internet).</p>
  <p>In the return statement of my component, I use <code>imageMap.map(item =&gt; ...)</code> to exhibit all elements of <code>imageMap</code> but it seems to be empty, since nothing appears. Am I doing something wrong?</p>