title: UseEffect dosen't trigger setState when using sessionStorage
body: <p>Hey I've go a problem with this code.</p>
  <pre><code>const [itemsCart, setCart] = useState([]);
    useEffect(() =&gt; {
      (async function (){
        const buffer = await JSON.parse(window.sessionStorage.getItem(&quot;itemsCart&quot;))
        setCart(buffer);
        console.log(buffer);
        console.log(itemsCart);
      })()
    }, []);
  
    useEffect(() =&gt; {
      window.sessionStorage.setItem(&quot;itemsCart&quot;, JSON.stringify(itemsCart));
    }, [itemsCart]);
  </code></pre>
  <p>The buffer gets the data, the state variable dosen't. I assume there must be a problem with synchronization however I'm not able to fix that.
  The output:
  <a href="https://i.stack.imgur.com/QQ8QU.png" rel="nofollow noreferrer">here</a></p>