title: How can I use state values as Meta tag content?
body: <p>I want a page link to preview an image and titles when shared. Using Nextjs Head Component for that purpose. I fetch all the necessary details on page load and use them as contents of the meta attributes.</p>
  <pre><code>let campaign = this.state.campaignDetails;
  &lt;React.Fragment&gt;
              &lt;Head&gt;
                  &lt;title&gt;{campaign!==null &amp;&amp; campaign.title}&lt;/title&gt;
                  &lt;meta name=&quot;title&quot; content={campaign!==null &amp;&amp; campaign.title}/&gt;
                  &lt;meta name=&quot;description&quot; content={campaign!==null ? campaign.description : undefined}&gt;&lt;/meta&gt;
                  &lt;meta name=&quot;image&quot; content={campaign!==null ? campaign.image : undefined}&gt;&lt;/meta&gt;
  
                  &lt;meta property=&quot;og:title&quot; content={campaign!==null ? campaign.title : undefined}/&gt;
                  &lt;meta property=&quot;og:type&quot; content=&quot;website&quot;/&gt;
                  &lt;meta property=&quot;og:site_name&quot; content=&quot;website&quot;/&gt;
                  &lt;meta property=&quot;og:url&quot; content=&quot;https://website.com/&quot;/&gt;
                  &lt;meta property=&quot;og:image&quot; content={campaign!==null ? campaign.image : undefined}/&gt;
                  &lt;meta property=&quot;og:description&quot; content={campaign!==null ? campaign.description : undefined}/&gt;
  
                  &lt;meta name=&quot;twitter:card&quot; content={campaign!==null ? campaign.image : undefined}/&gt;
                  &lt;meta name=&quot;twitter:title&quot; content={campaign!==null ? campaign.title : undefined}/&gt;
                  &lt;meta name=&quot;twitter:description&quot; content={campaign!==null ? campaign.description : undefined}/&gt;
                  &lt;meta name=&quot;twitter:site&quot; content=&quot;@website&quot;/&gt;
                  &lt;meta name=&quot;twitter:image&quot; content={campaign!==null ? campaign.image : undefined}/&gt;
                  &lt;meta name=&quot;twitter:creator&quot; content=&quot;@website&quot;/&gt;
              &lt;/Head&gt;
              &lt;div&gt;&lt;/div&gt;
   &lt;/React.Fragment&gt;
  </code></pre>
  <p>The above approach doesn't do as I require. I used react helmet to no avail.
  What am I missing? Any help is appreciated.</p>