Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
module.exports.head = () => {
const head = Helmet.renderStatic();
return [
head.title.toString(),
head.meta.toString(),
head.link.toString(),
head.style.toString(),
head.script.toString(),
].join('\n');
};
return e(Body, props,
e(makeHelmet, props),
e(props.page, props)
)
}
var output = renderToString(e(Main, {
page: require(process.env.STANDALONE),
meta: require(process.env.STANDALONE).meta,
pages: JSON.parse(process.env.ALLPAGESMETA),
location: {
pathname: process.env.PATHNAME,
search: ''
}
}))
var head = Helmet.renderStatic()
process.stdout.write(
'' +
'' +
'' +
head.meta.toString() +
head.base.toString() +
head.title.toString() +
head.link.toString() +
head.noscript.toString() +
head.script.toString() +
'' +
'' + output + '' +
''
)
route.setHTML(({ element, clientStats, relayPayload }) => {
const ReactDOM = require("react-dom/server");
const Helmet = require("react-helmet").default;
const flushChunks = require("webpack-flush-chunks").flushChunks;
const flushChunkNames = require("react-universal-component/server")
.flushChunkNames;
const app = ReactDOM.renderToString(element);
const { js, styles, cssHash } = flushChunks(clientStats, {
chunkNames: flushChunkNames()
});
const helmet = Helmet.renderStatic();
let title = helmet && helmet.title && helmet.title.toString();
let meta = helmet && helmet.meta && helmet.meta.toString();
return `
${title}
${meta}
${styles}