How to use the @material-ui/styles/StylesProvider.default function in @material-ui/styles

To help you get started, we’ve selected a few @material-ui/styles examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bluepeter / gatsby-material-ui-business-starter / gatsby-ssr.js View on Github external
// 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);