title: Window is not defined
body: <p>I am using ReactJS in my project and I would like to access my current URL like by using window.location.href. When I use window.location.href I get an error saying window is not defined.</p>
  
  <pre><code>// --- REACT + CUSTOM-TAGS ---
  const SampleApp = ({value}) =&gt; {
      // --- CUSTOM-SCRIPTS ---
      addMeta([
          {type: 'meta', content: {content: 'something'}},
          {type: 'link', content: {rel: 'http://link'}},
      ]);
  
      //Append the value from the URL
      const prId = "12512" //We can make it dynamic
      const url = window.location.href;//window,location.href;
      const id = url.substring(url.lastIndexOf('/') + 1);
      const output = id.replace(/[a-zA-Z=]/g, '');
  
      return (
          &lt;div&gt;
              &lt;h1&gt;Hello {value}&lt;/h1&gt;
              &lt;hr /&gt;
              &lt;h2&gt;{url} took from prId&lt;/h2&gt;
              &lt;hr /&gt;
              &lt;h2&gt;&lt;a className="redirect" href={'//www.check.com/prId/' + output} target="_blank"&gt;Click Here&lt;/a&gt;
              &lt;/h2&gt;
          &lt;/div&gt;
      );
  };
  </code></pre>