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

[TreeView] Use useDefaultProps instead of useThemeProps #14772

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

flaviendelangle
Copy link
Member

@flaviendelangle flaviendelangle commented Sep 30, 2024

Use the new API introduced by the core team.

We need to bump @mui/material deps to use 5.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.

@flaviendelangle flaviendelangle self-assigned this Sep 30, 2024
@flaviendelangle flaviendelangle requested review from siriwatknp and removed request for mnajdova September 30, 2024 08:27
@flaviendelangle flaviendelangle added the component: tree view TreeView, TreeItem. This is the name of the generic UI component, not the React module! label Sep 30, 2024
@mui-bot
Copy link

mui-bot commented Sep 30, 2024

Deploy preview: https://deploy-preview-14772--material-ui-x.netlify.app/

Generated by 🚫 dangerJS against d5652c8

@siriwatknp
Copy link
Member

@flaviendelangle I got this error, seems like there is a wrong usage of alpha()

Error: /Users/siriwatknp/practice-repos/tree-view-pigment-css/node_modules/@mui/x-tree-view/TreeItem2DragAndDropOverlay/TreeItem2DragAndDropOverlay.js: MUI: Unsupported `var(--mui-palette-primary-dark, #1565c0)` color.
The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().

It comes from TreeItem2DragAndDropOverlay, it should be:

…
    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)
    }

Copy link
Member

@siriwatknp siriwatknp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@flaviendelangle flaviendelangle added the on hold There is a blocker, we need to wait label Sep 30, 2024
Copy link
Member

@oliviertassinari oliviertassinari left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change component: tree view TreeView, TreeItem. This is the name of the generic UI component, not the React module! on hold There is a blocker, we need to wait
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants