How to use the react-jss.createGenerateId function in react-jss

To help you get started, we’ve selected a few react-jss 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 mimecuvalo / helloworld / server / app / app.js View on Github external
}, {}),
      }
    : null;
  const experiments = getExperiments(req);
  initializeLocalState(filteredUser, experiments);

  const apolloClient = createApolloClient(req);
  const context = {};

  const locale = getLocale(req);
  const translations = languages[locale];

  // For Material UI setup.
  const sheets = new ServerStyleSheets();
  const sheetsNonMaterialUI = new SheetsRegistry();
  const generateId = createGenerateId();

  const coreApp = ;
  // We need to set leave out Material-UI classname generation when traversing the React tree for
  // Apollo data. a) it speeds things up, but b) if we didn't do this, on prod, it can cause
  // classname hydration mismatches.
  const completeApp = isApolloTraversal => (
    
      
         apolloClient.extract()}
          appName={appName}
          appTime={gitInfo.gitTime}
          appVersion={gitInfo.gitRev}
          assetPathsByType={assetPathsByType}
          csrfToken={req.csrfToken()}
          defaultLocale={DEFAULT_LOCALE}
github zeit / next.js / examples / with-react-jss / pages / _document.js View on Github external
static async getInitialProps(ctx) {
    const registry = new SheetsRegistry()
    const generateId = createGenerateId()
    const originalRenderPage = ctx.renderPage
    ctx.renderPage = () =>
      originalRenderPage({
        enhanceApp: App => props => (
          
            
          
        ),
      })

    const initialProps = await Document.getInitialProps(ctx)

    return {
      ...initialProps,
      styles: (
        <>