[LoadingButton] defaultProps is no longer inherited from MuiButton defaultProps in @mui/lab 5.0.0-alpha.55 version
See original GitHub issueDuplicates
- I have searched the existing issues
Latest version
- I have tested the latest version
Current behavior 😯
I had a theme with changed variant
default prop value for MuiButton
. The previous versions of @mui/lab applied this value for MuiLoadingButton
components. Starting with version 5.0.0-alpha.55 it doesn’t work. Now we need also change default prop value for MuiLoadingButton
separately.
Expected behavior 🤔
It should inherit default prop value from MuiButton
as MuiLoadingButton
component is based on Button
and inherits all its props.
Steps to reproduce 🕹
createTheme
const theme = createTheme({
components: {
MuiButton: {
defaultProps: {
variant: 'contained',
},
},
// MuiLoadingButton: {
// defaultProps: {
// variant: 'contained',
// },
// },
}
});
test component
<ThemeProvider theme={theme}>
<LoadingButton>It should be contained</LoadingButton>
</ThemeProvider>
Context 🔦
No response
Your environment 🌎
`npx @mui/envinfo`
System:
OS: macOS 11.6.1
Binaries:
Node: 16.8.0 - /usr/local/bin/node
Yarn: 1.22.11 - /usr/local/bin/yarn
npm: 7.21.0 - /usr/local/bin/npm
Browsers:
Chrome: 95.0.4638.69
Edge: Not Found
Firefox: 92.0
Safari: 15.1
npmPackages:
@emotion/react: ^11.5.0 => 11.6.0
@emotion/styled: ^11.3.0 => 11.6.0
@mui/base: 5.0.0-alpha.55
@mui/icons-material: ^5.0.4 => 5.1.1
@mui/lab: ^5.0.0-alpha.55 => 5.0.0-alpha.55
@mui/material: ^5.1.0 => 5.1.1
@mui/private-theming: 5.1.1
@mui/styled-engine: 5.1.1
@mui/system: 5.1.1
@mui/types: 7.1.0
@mui/utils: 5.1.1
@types/react: ^17.0.0 => 17.0.35
react: ^17.0.2 => 17.0.2
react-dom: ^17.0.2 => 17.0.2
typescript: ^4.4.3 => 4.4.4
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (7 by maintainers)
Top Results From Across the Web
LoadingButton API - Material UI - MUI
Rule name Global class Description
root.MuiLoadingButton‑root Styles applied to the root element.
fullWidth.MuiLoadingButton‑fullWidth Styles applied to the root element if fullWidth= .
endIcon.MuiLoadingButton‑endIcon Styles applied to...
Read more >@mui/lab | Yarn - Package Manager
This package hosts the incubator components that are not yet ready to move to core . Installation. Install the package in your project...
Read more >Creating a defaultProps with createTheme in MUI v5 not working
I'm using Material-UI v5 for the first time, and I want to create a custom theme with createTheme to style a button component....
Read more >CHANGELOG.md · Gitee 极速下载/Material-UI - Gitee.com
Versions. 5.10.7. Sep 26, 2022. A big thanks to the 21 contributors who made this release possible. Here are some highlights ✨:.
Read more >node_modules/@mui/base/CHANGELOG.md · master · Daniel ...
This release was mostly around bug fixes and documentation improvements. ... @mui/lab@5.0.0-alpha.55. [LoadingButton] Text variant spacing fixed for ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Not sure why this is closed. Attempting to set MuiButton variant property using defaultProps does not seem to work, as of 5.8.7. Can we reopen, or should I open another issue?
If you are using TypeScript, you need to import types by leveraging module augmentation. See: https://mui.com/material-ui/about-the-lab/#typescript