title: React helmet server side correct setup
body: <p>Helmet right now is returning empty strings on server. I am not sure if the documentation explains it really well and the existing issues are rarely of any help ! </p>
  
  <p>Issue -</p>
  
  <pre><code>   `console.log('title', helmet.title.toString());
      console.log('meta', helmet.meta.toString());
      console.log('link', helmet.link.toString());`
  </code></pre>
  
  <p>are all empty except title which logs <code>&lt;title data-react-helmet="true"&gt;&lt;/title&gt;</code></p>
  
  <p>A very similar problem exists here - <a href="https://stackoverflow.com/questions/45822925/react-helmet-outputting-empty-strings-on-server-side">react-helmet outputting empty strings on server-side</a></p>
  
  <p>But it has ejected the app already for SSR. I haven't done so far and would wish not to only for react-helmet. 
  Second, I need to dynamically call the meta tags from API and fill the same.</p>
  
  <p>I am very unclear how these are working. How these pick up meta and links automatically underneath? Don't I need to set them? </p>
  
  <p>I will eventually want to add custom meta tags for every route. But lets' get started for home page atleast for helmet</p>
  
  <p><em>My implementation as per docs below:</em></p>
  
  <pre><code>import React from 'react';
  import ReactDOMServer from 'react-dom/server';
  import { Provider } from 'react-redux';
  import { ConnectedRouter } from 'react-router-redux';
  import store from '../../src/store';
  import {createMemoryHistory } from 'history';
  import { ServerStyleSheet } from 'styled-components';
  import Loadable from 'react-loadable';
  import manifest from '../../build/asset-manifest.json';
  import Helmet from 'react-helmet';
  import App from '../../src/containers/app';
  const path = require('path');
  const fs = require('fs');
  const history = createMemoryHistory({
    initialEntries: ['/', '/next', '/last'],
    initialIndex: 0
  });
  const modules = [];
  const extractAssets = (assets, chunks) =&gt; Object.keys(assets)
      .filter(asset =&gt; chunks.indexOf(asset.replace('.js', '')) &gt; -1)
      .map(k =&gt; assets[k]);
  
  export default (req, res, next) =&gt; {
      const filePath = path.resolve(__dirname, '..', '..', 'build', 'index.html');
      fs.readFile(filePath, 'utf8', (err, htmlData) =&gt; {
          if (err) {
              console.error('err', err);
              return res.status(404).end();
          }
          const sheet = new ServerStyleSheet();
          const body = ReactDOMServer.renderToString(
              sheet.collectStyles(&lt;Provider store={store}&gt;
                &lt;ConnectedRouter history={history}&gt;
                    &lt;Loadable.Capture report={m =&gt; modules.push(m)}&gt;
                         &lt;App /&gt;
                    &lt;/Loadable.Capture&gt;
                &lt;/ConnectedRouter&gt;
              &lt;/Provider&gt;)
          );
          const helmet = Helmet.renderStatic();
          console.log('title', helmet.title.toString());
          console.log('meta', helmet.meta.toString());
          console.log('link', helmet.link.toString());
          const styleTags = sheet.getStyleTags();
          const extraChunks = extractAssets(manifest, modules)
          .map(c =&gt; `&lt;script type="text/javascript" src="/${c}"&gt;&lt;/script&gt;`);
              return res.send(
                  htmlData.replace(
                      '&lt;html&gt;',
                      `&lt;html ${helmet.htmlAttributes.toString()}&gt;`
                  ).replace(
                      '&lt;head&gt;',
                      `&lt;head&gt;
                          ${helmet.title.toString()}
                          ${helmet.meta.toString()}
                          ${helmet.link.toString()}
                      &lt;/head&gt;`
                  ).replace(
                          '&lt;/head&gt;',
                          `${styleTags}&lt;/head&gt;`
                      ).replace(
                      '&lt;div id="root"&gt;&lt;/div&gt;',
                      `&lt;div id="root"&gt;${body}&lt;/div&gt;`
                  ).replace(
                      '&lt;body&gt;',
                      `&lt;body ${helmet.bodyAttributes.toString()}&gt;`
                  ).replace(
                      '&lt;/body&gt;',
                      extraChunks.join('') + '&lt;/body&gt;'
                  )
              );
          });
  };
  </code></pre>