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

[material-ui][Alert] Can't set slots in theme's defaultProps in 5.15.11 #41322

Closed
andrei-shoreline opened this issue Mar 1, 2024 · 3 comments · Fixed by #41324
Closed

[material-ui][Alert] Can't set slots in theme's defaultProps in 5.15.11 #41322

andrei-shoreline opened this issue Mar 1, 2024 · 3 comments · Fixed by #41324
Assignees
Labels
component: alert This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material regression A bug, but worse

Comments

@andrei-shoreline
Copy link

andrei-shoreline commented Mar 1, 2024

Steps to reproduce

Steps:

  1. Create a custom theme using createTheme
  2. Configure MuiAlert component:
const theme = createTheme({
  components: {
    MuiAlert: {
      defaultProps: {
        slots: {
          closeIcon: CloseRounded,
        },
      },
    },
  },
});

Current behavior

TypeScript gives the following error:

Object literal may only specify known properties, but 'slots' does not 
exist in type 'Partial<AlertProps>'. Did you mean to write 'slot'?

Expected behavior

It shouldn't throw an error and it should work the same as in the previous 5.15.10 version.

Context

In our application we customised the default theme using the createTheme utility.

Your environment

npx @mui/envinfo
  System:
    OS: macOS 14.3.1
  Binaries:
    Node: 20.11.1 - /opt/homebrew/opt/nvm/versions/node/v20.11.1/bin/node
    npm: 10.2.4 - /opt/homebrew/opt/nvm/versions/node/v20.11.1/bin/npm
    pnpm: Not Found
  npmPackages:
    @emotion/react: 11.11.4 => 11.11.4
    @emotion/styled: 11.11.0 => 11.11.0
    @mui/base:  5.0.0-beta.37
    @mui/core-downloads-tracker:  5.15.11
    @mui/icons-material: 5.15.11 => 5.15.11
    @mui/lab: 5.0.0-alpha.166 => 5.0.0-alpha.166
    @mui/material: 5.15.11 => 5.15.11
    @mui/private-theming:  5.15.11
    @mui/styled-engine:  5.15.11
    @mui/system:  5.15.11
    @mui/types:  7.2.13
    @mui/utils:  5.15.11
    @mui/x-data-grid: 6.19.5 => 6.19.5
    @mui/x-date-pickers: 6.19.5 => 6.19.5
    @types/react: 18.2.61 => 18.2.61
    react: 18.2.0 => 18.2.0
    react-dom: 18.2.0 => 18.2.0
    typescript: 5.3.3 => 5.3.3

Search keywords: Alert, slots, 5.15.11

@andrei-shoreline andrei-shoreline added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Mar 1, 2024
@andrei-shoreline andrei-shoreline changed the title [material-ui][Alert] Can't set default theme props in 5.15.11 [material-ui][Alert] Can't set slots in theme's defaultProps in 5.15.11 Mar 1, 2024
@danilo-leal danilo-leal added package: material-ui Specific to @mui/material component: alert This is the name of the generic UI component, not the React module! labels Mar 1, 2024
@sai6855 sai6855 added the regression A bug, but worse label Mar 5, 2024
@DiegoAndai DiegoAndai assigned DiegoAndai and unassigned siriwatknp Mar 5, 2024
@DiegoAndai DiegoAndai removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Mar 5, 2024
@DiegoAndai
Copy link
Member

Hey @andrei-shoreline, thanks for the report. We're working on it 👍🏼

@DiegoAndai
Copy link
Member

The fix should be released on the next version, v5.15.13, next week. Sorry for the inconvenience.

@andrei-shoreline
Copy link
Author

Thank you for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: alert This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material regression A bug, but worse
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants