Skip to content
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

Styled components using MUI 6.4.2 and react 19 with typescript 5.5.3 #45568

Open
miordache93 opened this issue Mar 13, 2025 · 1 comment
Open
Labels
status: waiting for maintainer These issues haven't been looked at yet by a maintainer

Comments

@miordache93
Copy link

miordache93 commented Mar 13, 2025

Steps to reproduce

Steps:

  1. Create a styled component using the following syntax (tried 2 different ways):
    `
import styled from '@mui/system/styled'; (tried to import it from several places but same result)

const StyledTextField = styled(TextField)(
  ({ theme }) => `
  border-bottom: 1px solid ${theme.colors.grey_10};
`,
);

const StyledTextField = styled(TextField, {
  shouldForwardProp: prop => prop !== 'customProp',
})<TextFieldProps & { customProp?: string }>({
  borderBottom: '2xp solid red',
});
`,
);`
  1. When using the styled component try accessing the props definitions. intellisense is no longer working
    and i'm unable to reach type definitions or get suggestions from my IDE (VSCode/Cursor)

If I use the component without styled method it works as before the upgrade.

Current behavior

Image

Expected behavior

Expected behavior comes from unstyled component.

Image

Context

No response

Your environment

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

    "@mui/icons-material": "6.4.2",
    "@mui/material": "6.4.2",
    "@mui/styles": "6.4.2",
    "@mui/system": "6.4.2",
    "@mui/utils": "6.4.2",

Search keywords: styled

@miordache93 miordache93 added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Mar 13, 2025
@miordache93
Copy link
Author

Mui versions:
"@mui/icons-material": "6.4.2",
"@mui/material": "6.4.2",
"@mui/styles": "6.4.2",
"@mui/system": "6.4.2",
"@mui/utils": "6.4.2",

Other packages versions:
"@types/react": "19.0.0",
"@types/node": "18.19.9",
"typescript": "^5.5.3",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting for maintainer These issues haven't been looked at yet by a maintainer
Projects
None yet
Development

No branches or pull requests

1 participant