Append HTML string to Next.js header
<p>I am getting data from API and it gives me an object with attribute <code>head: '<title>dummy title<title>'</code></p>
<p>When I call the HTML string in the head tag, it doesn't display anything. My code: </p>
<pre class="brush:php;toolbar:false;"><Head>{data.head}</Head></pre>
<p>I also tried: </p>
<pre class="brush:php;toolbar:false;"><Head>
<div dangerouslySetInnerHTML={{ __html: data.head }}></div>
</Head></pre>
<p>code<code><div dangerouslySetInnerHTML={{ __html: data.head }}></div></code> works for me in body but not in head, Because div cannot be called in the head. I also tried using Fragment instead of div but it doesn't work even in body. </p>