title: Get User Agent in getStaticProps in NextJs
body: <p>I am using <code>react-device-detect</code> package to detect whether the request is from a mobile or desktop device, it uses user agent of course to do that.</p>
  <p>In my NextJS project I want to use it on SSG pages.</p>
  <p>Imported the package</p>
  <pre><code>import { isMobile, getUA, getSelectorsByUserAgent } from 'react-device-detect';
  </code></pre>
  <p>And using the <code>getStaticProps</code> like this</p>
  <pre><code>export async function getStaticProps(context) {
  
    // Device React
    const deviceIsMobile = isMobile;
  
    const deviceType = deviceIsMobile ? 'Yes, I am a mobile' : 'Nope, Desktop!';
  
    return {
      props: {
         mobileDevice: deviceType
      }, // will be passed to the page component as props
    }
  }
  </code></pre>
  <p>And finally in my page's function</p>
  <pre><code>function AwesomePage( { mobileDevice } ) {
      return(
           &lt;h1&gt;{ mobileDevice }&lt;/h1&gt;
      )
  }
  </code></pre>
  <p>No matter what I always see 'Nope, Desktop!'.</p>
  <p>In some examples of <code>react-device-detect</code> I noticed that we may use the <code>userAgent</code> from the <code>req</code> param, but does <code>getStaticProps</code> even provide that, I checked and it seems it don't?  What's the way around this? I simply want to get user agent on an SSG page through <code>getStaticProps</code>.</p>
  <p>Thanks!</p>