-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
[material-ui][joy-ui] Add InitColorSchemeScript
for Next.js App Router
#42829
Conversation
InitColorSchemeScript
for Next.js App Router (#42247)InitColorSchemeScript
for Next.js App Router
Netlify deploy preview
@material-ui/core: parsed: +0.11% , gzip: +0.14% Bundle size reportDetails of bundle changes (Toolpad) |
@@ -121,23 +121,47 @@ If you try to render your UI based on the server, before mounting on the client, | |||
|
|||
### Avoiding screen flickering | |||
|
|||
To [prevent the UI from flickering](/joy-ui/main-features/dark-mode-optimization/#the-problem-flickering-on-first-load), apply `getInitColorSchemeScript()` before the main application script-it varies across frameworks: | |||
To [prevent the UI from flickering](/joy-ui/main-features/dark-mode-optimization/#the-problem-flickering-on-first-load), apply `<InitColorSchemeScript />` before the main application script-it varies across frameworks: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To [prevent the UI from flickering](/joy-ui/main-features/dark-mode-optimization/#the-problem-flickering-on-first-load), apply `<InitColorSchemeScript />` before the main application script-it varies across frameworks: | |
To [prevent the UI from flickering](/joy-ui/main-features/dark-mode-optimization/#the-problem-flickering-on-first-load), add the `<InitColorSchemeScript />` component before the `<CssVarsProvider />` component: |
Maybe rephrase, as it is no longer a script.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added one comment on the instructions. As it is cherry-pick I am not diving too deep into the implementaiton.
…/InitColorSchemeScript
Thanks @siriwatknp To double-check, is the deprecation notice intentional for the v5? |
Yes, the deprecation should happen on v6. I will open another PR to remove the warning. |
Cherry picked from #42247 to unblock MUI X on mui/mui-x#13712