-
Notifications
You must be signed in to change notification settings - Fork 27.4k
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
Update examples/with-emotion
to remove _document.js?
#17626
Comments
cc @timneutkens |
Switching to Before (custom document): Lighthouse Then again, I only use |
Thanks for the heads up! Copied your comment to #17651 . |
Update: No longer an issue. See comment below. 1.) Clone repo: 2.) Cd into project: 3.) Install, build and start local build: 4.) Visit http://localhost:3000/ (should load page without FOUC), then do a hard refresh at least 5 times: 5.) Open chrome tab, open dev tools, under |
Cool reproduction, thanks! Let's make sure this isn't in the final example! |
Just chiming in to say that following this comment, FOUC doesn't appear to be an issue anymore. |
examples/with-emotion
to remove _document.js? And upgrade to @emotion/cache?examples/with-emotion
to remove _document.js?
IMHO, using emotion without extracting critical CSS in the head should no be encouraged (what this PR does). I'm listing the downsides of the approach I can find in mui/material-ui#26561 (comment). But we will see how this turns into with the new server React components and Suspense SSR support in React 18. I have no idea. |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Feature request
Is your feature request related to a problem? Please describe.
The
examples/with-emotion
example is using Emotion 10.According to the Emotion SSR docs, the
_document.js
file is no longer required:Suggested Solution: Maybe this file can be removed?
Secondly, I noticed that the cache is using the original
emotion
as a dependency:next.js/examples/with-emotion/pages/_app.js
Line 5 in dd264f5
Suggested Solution: Maybe this can be switched to use the
createCache
function from@emotion/cache
instead?Describe the solution you'd like
Solutions suggested above.
Describe alternatives you've considered
Leave things how they are (more code, but maybe still works?)
The text was updated successfully, but these errors were encountered: