<h2 dir="auto">Describe the bug</h2>
<p dir="auto">Trying Next with layout pattern:</p>
<p dir="auto"><a href="https://github.com/zeit/next.js/tree/canary/examples/layout-component">https://github.com/zeit/next.js/tree/canary/examples/layout-component</a></p>
<p dir="auto">And the problem is that Layout component get remounted on every page change. I need to use layout component as a Container so it'll fetch data from server on every mount. How can I prevent layout to get re-mounted? Or am I missing something there?</p>
<h2 dir="auto">To Reproduce</h2>
<ol dir="auto">
<li>Download <a href="https://github.com/zeit/next.js/tree/canary/examples/layout-component">https://github.com/zeit/next.js/tree/canary/examples/layout-component</a></li>
<li>Add following code to Layout component:</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="React.useEffect(() =&gt; {
    console.log(&quot;layount mounted &quot; + new Date());
  }, []);
"><pre class="notranslate"><code class="notranslate">React.useEffect(() =&gt; {
    console.log("layount mounted " + new Date());
  }, []);

</code></pre></div>
<ol start="3" dir="auto">
<li>See how Layout get remounted on every page, even though it's not supposed to.</li>
</ol>
<h2 dir="auto">System information</h2>
<p dir="auto">MacOS<br>
Chrome<br>
Next.js latest</p>
<h2 dir="auto">Additional context</h2>
<p dir="auto">I've found a workaround in this article:<br>
<a href="https://adamwathan.me/2019/10/17/persistent-layout-patterns-in-nextjs/" rel="nofollow">https://adamwathan.me/2019/10/17/persistent-layout-patterns-in-nextjs/</a></p>
<p dir="auto">So maybe it's a feature request partly.</p>
<p dir="auto">I'm seeing that the contents of Head <code class="notranslate">(next/head)</code> are doubling when I use apollo, it doesn't seem to have any negative effects but I wanted to let you know.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/4278345/23579834/bec8da8c-00c3-11e7-8b35-ca7be982117c.png"><img src="https://cloud.githubusercontent.com/assets/4278345/23579834/bec8da8c-00c3-11e7-8b35-ca7be982117c.png" alt="issue" style="max-width: 100%;"></a></p>
<p dir="auto"><a href="https://github.com/Goluis/next-with-apollo-repeated-head">link to the repo</a></p>
<p dir="auto">the head is duplicated because of this:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="if (!process.browser) {
  const app = (
    &lt;ApolloProvider client={client} store={store}&gt;
      &lt;Component {...props} /&gt;
    &lt;/ApolloProvider&gt;
  )
  await getDataFromTree(app)
}"><pre class="notranslate"><span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-c1">!</span><span class="pl-s1">process</span><span class="pl-kos">.</span><span class="pl-c1">browser</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
  <span class="pl-k">const</span> <span class="pl-s1">app</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span>
    <span class="pl-c1">&lt;</span><span class="pl-ent">ApolloProvider</span> <span class="pl-c1">client</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-s1">client</span><span class="pl-kos">}</span> <span class="pl-c1">store</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-s1">store</span><span class="pl-kos">}</span><span class="pl-c1">&gt;</span>
      <span class="pl-c1">&lt;</span><span class="pl-ent">Component</span> <span class="pl-kos">{</span>...<span class="pl-s1">props</span><span class="pl-kos">}</span> <span class="pl-c1">/</span><span class="pl-c1">&gt;</span>
    <span class="pl-c1">&lt;</span><span class="pl-c1">/</span><span class="pl-ent">ApolloProvider</span><span class="pl-c1">&gt;</span>
  <span class="pl-kos">)</span>
  <span class="pl-k">await</span> <span class="pl-en">getDataFromTree</span><span class="pl-kos">(</span><span class="pl-s1">app</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">btw if I use <code class="notranslate">Head</code> multiple times, there should be no problem right ? (in the repo I'm using it only once)</p>