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] After updating to 5.16.0, the theme default props are disabled. #42892

Closed
naro143 opened this issue Jul 9, 2024 · 7 comments
Closed
Assignees
Labels
customization: theme Centered around the theming features package: material-ui Specific to @mui/material

Comments

@naro143
Copy link

naro143 commented Jul 9, 2024

Steps to reproduce

No response

Current behavior

No response

Expected behavior

No response

Context

Theme default props disabled after uploading from 5.15.21 to 5.16.0.

https://mui.com/material-ui/customization/theme-components/#theme-default-props

Your environment

npx @mui/envinfo

before

System:
    OS: macOS 14.5
  Binaries:
    Node: 20.14.0 - ~/.nodenv/versions/20.14.0/bin/node
    npm: 10.7.0 - ~/.nodenv/versions/20.14.0/bin/npm
    pnpm: Not Found
  Browsers:
    Chrome: 126.0.6478.127
    Edge: Not Found
    Safari: 17.5
  npmPackages:
    @emotion/react: 11.11.4 => 11.11.4
    @emotion/styled: 11.11.5 => 11.11.5
    @mui/base:  5.0.0-beta.40
    @mui/core-downloads-tracker:  5.16.0
    @mui/icons-material: 5.15.21 => 5.15.21
    @mui/material: 5.15.21 => 5.15.21
    @mui/private-theming:  5.16.0
    @mui/styled-engine:  5.15.14
    @mui/system:  5.16.0
    @mui/types:  7.2.14
    @mui/utils:  5.16.0
    @mui/x-data-grid:  7.8.0
    @mui/x-data-grid-pro: 7.8.0 => 7.8.0
    @mui/x-date-pickers:  7.8.0
    @mui/x-date-pickers-pro: 7.8.0 => 7.8.0
    @mui/x-license: 7.8.0 => 7.8.0
    @types/react: 18.3.3 => 18.3.3
    react: 18.3.1 => 18.3.1
    react-dom: 18.3.1 => 18.3.1
    typescript: 5.5.3 => 5.5.3

after

  System:
    OS: macOS 14.5
  Binaries:
    Node: 20.14.0 - ~/.nodenv/versions/20.14.0/bin/node
    npm: 10.7.0 - ~/.nodenv/versions/20.14.0/bin/npm
    pnpm: Not Found
  Browsers:
    Chrome: 126.0.6478.127
    Edge: Not Found
    Safari: 17.5
  npmPackages:
    @emotion/react: 11.11.4 => 11.11.4
    @emotion/styled: 11.11.5 => 11.11.5
    @mui/base:  5.0.0-beta.40
    @mui/core-downloads-tracker:  5.16.0
    @mui/icons-material: 5.16.0 => 5.16.0
    @mui/material: 5.16.0 => 5.16.0
    @mui/private-theming:  5.16.0
    @mui/styled-engine:  5.15.14
    @mui/system:  5.16.0
    @mui/types:  7.2.14
    @mui/utils:  5.16.0
    @mui/x-data-grid:  7.9.0
    @mui/x-data-grid-pro: 7.9.0 => 7.9.0
    @mui/x-date-pickers:  7.9.0
    @mui/x-date-pickers-pro: 7.9.0 => 7.9.0
    @mui/x-internals:  7.9.0
    @mui/x-license: 7.9.0 => 7.9.0
    @types/react: 18.3.3 => 18.3.3
    react: 18.3.1 => 18.3.1
    react-dom: 18.3.1 => 18.3.1
    typescript: 5.5.3 => 5.5.3

Search keywords: Theme default props, 5.16.0

@naro143 naro143 added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jul 9, 2024
@zannager zannager added package: system Specific to @mui/system customization: theme Centered around the theming features labels Jul 9, 2024
@ZeeshanTamboli
Copy link
Member

@naro143 I didn't understand your issue. Are the default props passed to the theme not working? In the documentation link you provided, it shows that disableRipple: true disables the ripples which does work.

@ZeeshanTamboli ZeeshanTamboli added status: waiting for author Issue with insufficient information package: material-ui Specific to @mui/material and removed package: system Specific to @mui/system status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jul 9, 2024
@ZeeshanTamboli ZeeshanTamboli changed the title After updating to 5.16.0, Theme default props are disabled. [material-ui] After updating to 5.16.0, the theme default props are disabled. Jul 9, 2024
@naro143
Copy link
Author

naro143 commented Jul 10, 2024

@ZeeshanTamboli
The default props passed to the theme not working.

The document disableRipple: true also works in 5.15.21, but not in 5.16.0.

@github-actions github-actions bot added status: waiting for maintainer These issues haven't been looked at yet by a maintainer and removed status: waiting for author Issue with insufficient information labels Jul 10, 2024
@choutkamartin
Copy link

I confirm that this is an issue in 5.16.0 as well

@ZeeshanTamboli
Copy link
Member

Can you provide a CodeSandbox or StackBlitz reproducing the issue? I cannot reproduce it on version 5.16.0: https://codesandbox.io/p/sandbox/dazzling-chebyshev-tl548c?file=%2Fsrc%2FDemo.tsx%3A8%2C21

@ZeeshanTamboli ZeeshanTamboli added status: waiting for author Issue with insufficient information and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jul 10, 2024
@choutkamartin
Copy link

choutkamartin commented Jul 10, 2024

I can confirm, that this is not an issue with Material UI.

The issue is in our application:

import { ThemeProvider } from '@emotion/react'  // incorrect
import { ThemeProvider } from '@mui/material'   // correct

We supposedly did auto import on the ThemeProvider dependency, which resulted in import from emotion itself. This worked until 5.16.0

@naro143 Check whether you don't have the same issue

@naro143
Copy link
Author

naro143 commented Jul 10, 2024

@choutkamartin

We supposedly did auto import on the ThemeProvider dependency, which resulted in import from emotion itself. This worked until 5.16.0

The same was imported from @emotion/react.
Importing from @mui/material solved the problem.

Thanks for the great research!

@github-actions github-actions bot added status: waiting for maintainer These issues haven't been looked at yet by a maintainer and removed status: waiting for author Issue with insufficient information labels Jul 10, 2024
@ZeeshanTamboli ZeeshanTamboli removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jul 11, 2024
@danielkrich
Copy link

Happens to us as well when we updated from 5.13.4 to 5.16.6
We're not importing ThemeProvider from "emotion" , but from "@mui/material" as needed...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customization: theme Centered around the theming features package: material-ui Specific to @mui/material
Projects
None yet
Development

No branches or pull requests

6 participants