[StepConnector][StepContent][StepLabel] Remove deprecated props and classes by siriwatknp · Pull Request #48058 · mui/material-ui (original) (raw)
Summary
Remove all deprecated props and classes from Step* components:
- StepConnector: Remove deprecated classes
lineHorizontalandlineVertical - StepContent: Remove deprecated props
TransitionComponentandTransitionProps - StepLabel: Remove deprecated props
componentsProps,StepIconComponent, andStepIconProps
Breaking changes
StepConnector
lineHorizontalclass removed — combine.MuiStepConnector-horizontaland.MuiStepConnector-lineinsteadlineVerticalclass removed — combine.MuiStepConnector-verticaland.MuiStepConnector-lineinstead
StepContent
TransitionComponentprop removed — useslots.transitioninsteadTransitionPropsprop removed — useslotProps.transitioninstead
StepLabel
componentsPropsprop removed — useslotPropsinsteadStepIconComponentprop removed — useslots.stepIconinsteadStepIconPropsprop removed — useslotProps.stepIconinstead
Codemods available:
npx @mui/codemod@latest deprecations/step-connector-classes
Relates to #47987
| if (transitionDurationProp === 'auto' && !TransitionComponent.muiSupportAuto) { |
| const TransitionSlotComponent = slots.transition ?? StepContentTransition; |
| if (transitionDurationProp === 'auto' && !TransitionSlotComponent.muiSupportAuto) { |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
StepContentTransition.muiSupportAuto will always be undefined in this check because it's checking a styled wrapper as opposed to the raw Collapse component like before
The Claude code suggested fix is to follow Popover and pass Collapse as the elementType param of useSlot:
| const [TransitionSlot, transitionSlotProps] = useSlot('transition', { |
|---|
| elementType: Grow, |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you check again, I simplify it without removing the StepContentTransition styled component.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good ~
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})