-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using a styled(Grid) results in an error from 'RegularBreakpoints' #33165
Comments
I can confirm this (recent) problem. For the moment I'm workarounding it by forcing the type |
@rejetto good idea 馃憤馃徎, much better than just reverting to 5.8.3 I ended up going with |
This comment was marked as outdated.
This comment was marked as outdated.
Hmmm... I have created react project using vite.js (NOT create-react-app). import { styled, Grid } from '@mui/material';
export const StyledGrid = styled(Grid)(({ theme }) => ({})); BUT, there are no error. |
@jooohyun you are right, I can't repro - https://codesandbox.io/s/charming-colden-qgvwx5?file=/src/App.tsx |
I'm using CRA |
@rejetto please share a codesandbox with a reproduction |
https://codesandbox.io/s/kind-chatterjee-7bwd6w?file=/src/index.tsx this is CRA(typescript) project. as you can see there are no errors. |
Sorry, I didn't notice I've been quite inaccurate. So this is where I hade to force the type And these are related configurations Version of mui is actually found here, which I just checked it is 5.8.4 I'm sorry I'm not providing better information, but it may take long before I find the necessary time. |
Sorry, but this is not enough info for us to look into. Please re-open the issue when there is a reproduction that we can look into. |
Sure! I discovered the error disappears on my side when I disable Typescript needs the exported type to generate a valid .d.ts . At this very moment I ran out of time (rushing to work), and cannot proceed testing your proposed solution, but it seems fine to me. |
@rejetto is exactly right. You will not see this error if you don't also update your All that would need to be done to address this issue would be |
Having the same issue in a UI package in a monorepo. |
@achendrick is exactly right! All that needs to be done to fix this is to export the https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Grid/Grid.d.ts#L22 |
I've created a PR for it - #33751 |
Duplicates
Latest version
Current behavior 馃槸
Doing the above is resulting in the following error
Exported variable 'StyledGrid' has or is using name 'RegularBreakpoints' from external module "{project_path}/node_modules/@mui/material/Grid/Grid" but cannot be named.
Expected behavior 馃
If I export
RegularBreakpoints
the error goes away so I'd expect that or a similar solution.Steps to reproduce 馃暪
Steps:
@mui/material
Context 馃敠
No response
Your environment 馃寧
.tsconfig
The text was updated successfully, but these errors were encountered: