-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[TreeView] Use useDefaultProps
instead of useThemeProps
#14772
base: master
Are you sure you want to change the base?
Conversation
Deploy preview: https://deploy-preview-14772--material-ui-x.netlify.app/ |
@flaviendelangle I got this error, seems like there is a wrong usage of
It comes from …
style: {
marginLeft: 'calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))',
borderRadius: theme.shape.borderRadius,
- backgroundColor: alpha((theme.vars || theme).palette.primary.dark, 0.15)
+ backgroundColor: alpha(theme.palette.primary.dark, 0.15)
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works with Pigment CSS https://github.com/siriwatknp/x-tree-view-pigment-css
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To note that we have mui/material-ui#43443 that advocates for removing this API.
@oliviertassinari we'll wait for the core to settle on an API then But I don't understand what you are proposing to allow people to set default value to their props globally. |
The TL:DR of the thought process behind the issue I linked was:
If each step of the reasoning is right (to be confirmed), then I think that no MUI X propagation makes the most sense. Sure, we could propagate those in MUI X, if we are happy to refactor it again in the future, but then, why not spend that same time fixing the root? |
So you are planning to remove the ability to define default value to the props globally? |
@flaviendelangle Default global props sound important. I think stringifiable props was great to POC, but if we can duplicate the theme, have it as a JavaScript object, define it once in the server-side bundle, and once in the client-side bundle then this seems to be a much better solution. I spent 1hr on this to prove the previous points: https://github.com/oliviertassinari/test-theme. It seems to work. |
OK |
@flaviendelangle I would imagine so. Assuming there is not benefits to change those APIs. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
@oliviertassinari From what I know, any prop can be set through |
@brijeshb42 See https://github.com/oliviertassinari/test-theme the theme doesn't need to be serializable for useTheme to work with RSC. Can we:
before going to beta? |
Use the new API introduced by the core team.
We need to bump
@mui/material
deps to use5.16.0
or above in order to support it, which makes this a breaking change.I'm opening this PR to check with the core if the approach is good before preparing the one for the pickers to merge it at the beginning of the alpha.