Initializing and using `sessionStorage` in React
<p>I'm currently trying to save an item into <a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage" rel="nofollow noreferrer"><code>sessionStorage</code></a> before rendering occurs.</p>
<p>My code is something like this:</p>
<pre class="lang-js prettyprint-override"><code>  componentWillMount() {
    sessionStorage.setItem(&quot;isUserLogged&quot;, false);
  }
</code></pre>
<p>However, it says that &quot;<code>sessionStorage</code> is not defined.&quot; How do I use <code>sessionStorage</code> in React before rendering occurs?</p>