title: React change subdomain dynamically
body: <p>I am using react to build an application and there is one API integrated which gives me subdomain in the response. I am saving the whole response in <code>organization</code> object variable.</p>
  <p>How do I configure my application to switch to that subdomain once its retrieved? I went through some articles around the web but couldn't figure it out. I have tried like this also:</p>
  <pre><code>  useEffect(() =&gt; {
      if (organization.org.subdomain !== null &amp;&amp; organization.org.subdomain !== undefined) {
        window.location.assign(organization.org.subdomain)
      }
    },[organization.org.subdomain])
  </code></pre>
  <p>Note: I am using hash-router.</p>