-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[Theme Customization] defaultProps doesn't support deep merge #37585
Comments
Facing the same issue, can't define default elevation for dialog via i.e. @mnajdova you have any update on this? |
I did some digging and found out that this MR happened, which seem to resolve deep merge, but only for However, not all of the components internals customisable via As an idea perhaps that deep merge could be applied to any prop that ends with Just in case it needs any more reproduction: |
At first, the plan was to add missing Anyway, I still want to add the missing // v7
// use case I: simple use case
import Autocomplete from '@mui/material/Autocomplete';
<Autocomplete … slotProps={{ input: { … }, arrow: {…} }} />
// use case II: composition
import { AutocompleteRoot, AutocompleteInput, Autocomplete… } from '@mui/material/Autocomplete';
<AutocompleteRoot>…</AutocompleteRoot> What's your thought? @DiegoAndai @aarongarciah |
Does it mean that all component will have ability to provide any of their children Props via |
Yes, that's correct. @DiegoAndai I think we miss the Dialog, it haven't been migrated to |
@siriwatknp If I willing to contribute to expedite this issue, could you perhaps point me to some PR example for this change? |
@alexey-kozlenkov you can follow the progress on slots being implemented here: #41281 But this issue is on hold as we discuss the path forward regarding slots. @siriwatknp's suggestion makes sense to me, but there's no agreement yet. When there's an agreement, which should come soon, we'll know the next step to solve this issue. |
@DiegoAndai I see, thanks for replying here. |
Duplicates
Latest version
Steps to reproduce 🕹
Link to live example:
Steps:
Current behavior 😯
The second card doesn't respect the theme customization. Because it has an
{}
prop value that replace (instead of merge) the theme's defaultProps.Expected behavior 🤔
Should the props be deep merged with defaultProps?
Context 🔦
No response
Your environment 🌎
npx @mui/envinfo
The text was updated successfully, but these errors were encountered: