Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// See https://github.com/mui-org/material-ui/tree/master/examples/gatsby
const React = require("react"),
{ renderToString } = require("react-dom/server"),
StylesProvider = require("@material-ui/styles/StylesProvider").default,
getPageContext = require("./src/utils/getPageContext").default;
function replaceRenderer({
bodyComponent,
replaceBodyHTMLString,
setHeadComponents,
}) {
// Get the context of the page to collected side effects.
const muiPageContext = getPageContext(),
bodyHTML = renderToString(
{bodyComponent}
);
replaceBodyHTMLString(bodyHTML);