title: StencilJs render component in new window
body: <p>I am looking for ways how to render chat widget created with stenciljs in a new window using window.open.</p>
  <p>The new window is opened when clicking on the widget icon and it should preserve whatever state it currently has while navigating on the website. It should also have the styles and functionality of the parent.</p>
  <p>I understand that with React I could utilise the portal so achieve that. But does anyone know how to do that with stenciljs? Or should I try to use React with Stenciljs and see where it goes?</p>
  <p>Mock code:</p>
  <pre><code>&lt;Host class=&quot;chat&quot;&gt;
   {this.state.open ? (
     &lt;div class=&quot;chat-wrapper&quot;&gt;
       &lt;chat-header customparam={this.customparam} /&gt;
       &lt;chat-content anotherparam={this.anotherparam} /&gt;
     &lt;/div&gt; 
    ) : (
     &lt;open-chat
       label={this.state.openChatLabel}
       onClick={this.openChat.bind(this)} /&gt;
     )}
  &lt;/Host&gt;
  </code></pre>
  <p>So I want to open this part in new window:</p>
  <pre><code>&lt;div class=&quot;chat-wrapper&quot;&gt;
    &lt;chat-header customparam={this.customparam} /&gt;
    &lt;chat-content customparam={this.customparam} /&gt;
  &lt;/div&gt; 
  </code></pre>
  <p>I've already tried writing to the new window and appending header and content there. But there is likely a better way to do it. If any of you know how or have ideas, please share. Will do a wrap-up once this is solved.</p>