[ListItem, ListItemText] Remove deprecated props by siriwatknp · Pull Request #48042 · mui/material-ui (original) (raw)
Summary
Remove deprecated props from ListItem and ListItemText components. Remove the @deprecated annotation from ListItemSecondaryAction (the component remains public).
Breaking changes
ListItem:
components— useslotsinsteadcomponentsProps— useslotPropsinsteadContainerComponent— usecomponentorslots.rootinsteadContainerProps— useslotProps.rootinstead- The v4 pattern of using
ListItemSecondaryActionas a child is no longer supported. Use thesecondaryActionprop instead. - The
containerCSS class has been removed (was only used by the v4 child pattern).
ListItemText:
primaryTypographyProps— useslotProps.primaryinsteadsecondaryTypographyProps— useslotProps.secondaryinstead
Migration
npx @mui/codemod@latest deprecations/list-item-props
Note to reviewers
I decided not to remove the ListItemSecondaryAction component (there was a comment to remove it but I believe that it was there before slots/slotProps were introduced).
To reduce the breaking changes surface, I don't see good reason to remove it because this customization is possible:
<ListItem secondaryAction={} slots={{ secondaryAction: ListItemSecondaryAction }}>