Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import symbol from '../assets/twitter.svg';
// Import sprite instance which already contains twitter logo required above
import sprite from 'svg-sprite-loader/runtime/sprite.build';
// Render sprite
const spriteContent = sprite.stringify();
const pageContent = `
${spriteContent}
<svg viewBox="${symbol.viewBox}">
</svg>
`;
${helmet.title.toString()}
${helmet.script.toString()}
${helmet.meta.toString()}
${helmet.link.toString()}
<style type="text/css" id="jss-server-side">${css}</style>
${sprite.stringify()}
<div id="react-app">${reactDom}</div>
${scriptTags}
`;
}
public static async getInitialProps(ctx: DocumentContext) {
const initialProps = await Document.getInitialProps(ctx)
const spriteContent = sprite.stringify()
return {
spriteContent,
...initialProps,
}
}