Created
June 4, 2018 17:07
-
-
Save SaraVieira/78c0fab142c630f3ec32ec2bb58d43fb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
import { Helmet } from 'react-helmet' | |
.... | |
const helmet = Helmet.renderStatic() | |
res.send(`<!doctype html> | |
<html lang="en" ${helmet.htmlAttributes.toString()}> | |
<head> | |
${helmet.title.toString()} | |
${helmet.meta.toString()} | |
${helmet.link.toString()} | |
${assets.client.css | |
? `<link rel="stylesheet" href="${assets.client.css}">` | |
: '' } | |
${process.env.NODE_ENV === 'production' | |
? `<script src="${assets.client.js}" defer></script>` | |
: `<script src="${assets.client.js}" defer crossorigin></script>`} | |
<style>${fontawesome.dom.css()}</style> | |
</head> | |
<body ${helmet.bodyAttributes.toString()}> | |
<div id="root">${markup}</div> | |
</body> | |
</html>` | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment