-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flash of Unstyled Content while using customized _document #8
Comments
Hi can you provide a little more information about how you are handling your styles? I use emotion 10 and haven't encountered this issue. I also don't directly call the renderToHTML method, I call render. Can you also provide a sample of your _document file as well as checking out this issue from the nextjs repo? |
Hi, @kyle-mccarthy I'm using material-ui and this _document.tsx setting. https://github.com/mui-org/material-ui/blob/next/examples/nextjs-next-with-typescript/pages/_document.tsx BTW, Thanks for your work. |
Thanks for sending that over. Unfortunately it looks like the example they provided is wrong. The call renderPage directly from the context, rather than using the enhancer which can cause the flash reported in this issue on the nextjs repo. I messed around with their material-next example a little bit and was able to get it working with the enhanceApp, here is the gist. However, it looks like V4 uses a new SSR API, so it isn't likely to work when they release V4 in a couple of days. Since this isn't really related to this repo, and is more of a question about using material-ui with next I am going to close this issue. I encourage you to ask the material-ui devs about an alternative to calling renderPage directly, since other people probably are having the same issue. You may want to attach the nextjs issue (#5629) I referenced above. |
It seems that the customized _document hasn't been attached to the renderOpts in renderToHTML function of next-server.
I'm using "next": "8"
The text was updated successfully, but these errors were encountered: