Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

222
Vistas
How to use material-ui ServerStyleSheets with getStaticProps?

Official material-ui github repo gives an example how to integrate material-ui with next.js - nextjs/pages/_document.js

In this example styles generated in getInitialProps, but it's not the best way due to performance reasons:

  1. getInitialProps enables server-side rendering and can't be statically optimized. In this case it runs every time we open a page.
  2. It causes issues with Vercel hosting - cold start sometimes takes 5-10 seconds and user just see white screen.

It isn't possible to just replace getInitialProps by getStaticProps because getStaticProps doesn't work in /pages/_document.js and /pages/_app.js files.

Does anyone solved this issue?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda