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][Drawer] Deprecate *Props and complete slots, slotProps #44960

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

Conversation

siriwatknp
Copy link
Member

@siriwatknp siriwatknp commented Jan 7, 2025

Part of #41281, blocked by #44959

This PR also include SwipeableDrawer because it has Drawer as a direct dependency.

  • Deprecate BackdropComponent, BackdropProps, PaperProps, SlideProps in favor of slots.backdrop, slotProps.backdrop, slotProps.paper, slotProps.transition respectively.
  • Adopt mergeSlotProps to handle callbacks properly.
  • Added a codemod (tested by transforming the drawer demos)
  • Updated the migration doc

Note: I decided not to deprecate ModalProps because it cannot be migrated to slotProps.root. This case is special because the DrawerRoot is a wrapper of Modal (a Material UI component), so the ModalProps must to be spread directly to Modal, not through slotProps.root.

Also, ModalProps cannot be spread directly to Drawer because it's specific to <Drawer variant="temporary">.


@siriwatknp siriwatknp added on hold There is a blocker, we need to wait component: drawer This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material component: SwipeableDrawer The React component. labels Jan 7, 2025
@mui-bot
Copy link

mui-bot commented Jan 7, 2025

Netlify deploy preview

SwipeableDrawer: parsed: +1.03% , gzip: +0.86%
Drawer: parsed: +0.88% , gzip: +0.70%
@material-ui/core: parsed: +0.11% , gzip: +0.10%

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against 527908e

@siriwatknp siriwatknp removed the on hold There is a blocker, we need to wait label Jan 8, 2025
@siriwatknp siriwatknp marked this pull request as ready for review January 9, 2025 09:59
@siriwatknp siriwatknp requested a review from DiegoAndai January 9, 2025 10:07
@siriwatknp siriwatknp requested a review from sai6855 January 9, 2025 10:07
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Jan 10, 2025
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: drawer This is the name of the generic UI component, not the React module! component: SwipeableDrawer The React component. package: material-ui Specific to @mui/material
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants