title: Window is not defined in Next.js React app
body: <p>In my <strong><a href="https://nextjs.org/" rel="noreferrer">Next.js</a></strong> app I can't seem to access <code>window</code>:</p>
  <blockquote>
  <p>Unhandled Rejection (ReferenceError): window is not defined</p>
  </blockquote>
  <pre><code>componentWillMount() {
      console.log('window.innerHeight', window.innerHeight);
  }
  </code></pre>
  <p><a href="https://i.stack.imgur.com/m5ZoN.png" rel="noreferrer"><img src="https://i.stack.imgur.com/m5ZoN.png" alt="Enter image description here" /></a></p>