Skip to content

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

Closed
@miordache93

Description

@miordache93

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

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions