-
-
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] Remove use client
from the index styles
#41131
Conversation
Netlify deploy previewhttps://deploy-preview-41131--material-ui.netlify.app/ Bundle size reportDetails of bundle changes (Toolpad) |
@@ -1,9 +1,9 @@ | |||
'use client'; | |||
// do not remove the following import (https://github.com/microsoft/TypeScript/issues/29808#issuecomment-1320713018) | |||
/* eslint-disable @typescript-eslint/no-unused-vars */ | |||
// @ts-ignore | |||
import * as React from 'react'; |
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.
Dead logic?
import * as React from 'react'; |
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.
Required, see https://ci.codesandbox.io/status/mui/material-ui/pr/41131/builds/473769.
stdout: "../mui-material/src/styles/CssVarsProvider.tsx(15,9): error TS2742: The inferred type of 'CssVarsProvider' cannot be named without a reference to 'packages/mui-types/node_modules/@types/react'. This is likely not portable. A type annotation is necessary.\n" +
"../mui-material/src/styles/getInitColorSchemeScript.ts(13,25): error TS2742: The inferred type of 'getInitColorSchemeScript' cannot be named without a reference to 'packages/mui-types/node_modules/@types/react'. This is likely not portable. A type annotation is necessary.\n",
stderr: '
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.
Ah right, @Janpot left a comment about this above. The .d.ts file generated https://unpkg.com/browse/@mui/[email protected]/styles/CssVarsProvider.d.ts needs this import.
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.
Would the following work as well without the @ts-ignore
?
/// <reference types="react" />
use-client
from the index stylesuse client
from the index styles
I wonder if Next.js warns when not using https://nextjs.org/docs/app/building-your-application/optimizing/scripts#inline-scripts |
Maybe the |
I got this error after removing
|
closes #42750