I'm trying to load my react-helmet tags server-side so that these are injected into the static html file at build time. This would allow things like Facebook to take the source file directly and use the appropriate meta-tags.
After configuring my application with this, all I see in the server side static render output is:
<title data-react-helmet="true"></title>
Setup:
gatsby-config.js
module.exports = {
plugins: ['gatsby-plugin-react-helmet']
}
app.tsx
import Helmet from 'react-helmet';
const Head: React.FunctionComponent<Props> = () => (
<Helmet title="the title is big" >
<meta name="description" content="the content" />
</Helmet >
);
...
gatsby-ssr.js
const {Helmet} = require('react-helmet');
exports.onRenderBody = () => {
console.log(Helmet.renderStatic())
}
**Output**
<title data-react-helmet="true"></title>
Any ideas?
` is loaded into the a page template as a component.
– Appa Mar 06 '19 at 09:15