title: React JS - How to detect navigator.platform in Next JS
body: <p>I'm writing a small function in Next JS with react. When I use navigator, I get the following error.</p>
  <p><code>ReferenceError: navigator is not defined</code></p>
  <p>Here's my code:</p>
  <pre><code>import React from &quot;react&quot;;
  
  export default function App() {
  
  const isMac = navigator.platform.toUpperCase().indexOf(&quot;MAC&quot;) &gt;= 0;
  
    return (
     {isMac ? &quot;I'm mac&quot; : &quot;I'm windows&quot;}
    );
  }
  </code></pre>
  <p>How do I get browser platform and then render a section based on that?</p>