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

[base-ui] Remove classes prop from the Base UI components that have it #36157

Merged
merged 16 commits into from
Feb 21, 2023

Conversation

hbjORbj
Copy link
Member

@hbjORbj hbjORbj commented Feb 12, 2023

Breaking Changes

  • classes prop is removed from ModalUnstyled, SliderUnstyled, TablePaginationUnstyled and TablePaginationActionsUnstyled.

  • You can replace the classes prop by providing the class name prop directly to the prop via slotProps. Below is an example of how the migration should look like:

     <TablePaginationUnstyled
    -   classes={{ toolbar: 'toolbar-classname', menuItem: 'menuItem-classname' }}
    +   slotProps={{ toolbar: { className: 'toolbar-classname' }, menuItem: { className: 'menuItem-classname'}}}
     />

Closes #36129

Changes:

ModalUnstyled, SliderUnstyled, TablePaginationUnstyled and TablePaginationActionsUnstyled still support classes prop. This PR drops the prop from these components.

@hbjORbj hbjORbj changed the title [base] Remove classes prop [base] Remove classes prop from the Base components that have it Feb 12, 2023
@hbjORbj hbjORbj self-assigned this Feb 12, 2023
@hbjORbj hbjORbj added breaking change package: base-ui Specific to @mui/base labels Feb 12, 2023
@hbjORbj hbjORbj added this to the MUI Base stable release milestone Feb 12, 2023
@mui-bot
Copy link

mui-bot commented Feb 12, 2023

Netlify deploy preview

https://deploy-preview-36157--material-ui.netlify.app/

Bundle size report

Details of bundle changes

Generated by 🚫 dangerJS against 0ce683c

@hbjORbj hbjORbj added enhancement This is not a bug, nor a new feature and removed breaking change labels Feb 12, 2023
@michaldudak
Copy link
Member

After the change, it's not possible to add custom classes to the Modal (I haven't checked the other components). Could you please take a look at it?

@hbjORbj
Copy link
Member Author

hbjORbj commented Feb 14, 2023

I think this is ready for 2nd review. I'd appreciate it.

Copy link
Member

@ZeeshanTamboli ZeeshanTamboli left a comment

Choose a reason for hiding this comment

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

I hope you don't mind the review. Just saw this PR after #35963 (comment).

packages/mui-material/src/Modal/Modal.js Show resolved Hide resolved
packages/mui-material/src/Modal/Modal.js Show resolved Hide resolved
packages/mui-material/src/Modal/Modal.js Show resolved Hide resolved
Copy link
Member

@michaldudak michaldudak left a comment

Choose a reason for hiding this comment

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

Works much better now. Good job adding the tests!

Copy link
Member

@michaldudak michaldudak left a comment

Choose a reason for hiding this comment

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

Looks solid!

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Feb 21, 2023
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Feb 21, 2023
@hbjORbj hbjORbj merged commit ef63421 into mui:master Feb 21, 2023
siriwatknp pushed a commit to mnajdova/material-ui that referenced this pull request Feb 24, 2023
@mnajdova
Copy link
Member

@hbjORbj would be great if you can provide a Breaking changes section in the PR description next time when there is a breaking change involved. This will make the release much faster.

@hbjORbj
Copy link
Member Author

hbjORbj commented Feb 27, 2023

Gottcha. On it.

@oliviertassinari oliviertassinari changed the title [base] Remove classes prop from the Base components that have it [base-ui] Remove classes prop from the Base UI components that have it Feb 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change enhancement This is not a bug, nor a new feature package: base-ui Specific to @mui/base
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[base] Remove the classes props
5 participants