-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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][StepContent] Add slots and slotProps #44742
Conversation
Netlify deploy previewStepContent: parsed: +2.37% , gzip: +2.08% Bundle size reportDetails of bundle changes (Toolpad) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sai6855 I replied in #42157 (comment), but that's a special case. For TransitionComponent
, lets deprecate as we did with the others: https://mui.com/material-ui/migration/migrating-from-deprecated-apis/#transitioncomponent
Besides that, the PR is good 👍🏼 but please let's deprecate in the same PR.
In cases you shown above, |
@sai6855 thanks for checking. I still think we should go forward with the deprecation, as:
Again, thanks for checking first. I think it won't be a problem, but if users have issues, we can remove/change the deprecation in the future. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @sai6855, sorry for not being clearer before: I only meant we should add the deprecation, not change how TransitionComponent
is handled, see the comment below.
This is so change happens only when migrating to slots, and not when upgrading to a new version. Does that make sense?
@@ -110,9 +110,7 @@ const StepContent = React.forwardRef(function StepContent(inProps, ref) { | |||
ownerState={ownerState} | |||
{...other} | |||
> | |||
<TransitionSlot as={TransitionComponent} {...transitionProps}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets revert this change, TransitionComponent
should still be passed through as
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opps! as
prop somehow got lost, added it back here 3dc1b68
@@ -83,24 +86,33 @@ const StepContent = React.forwardRef(function StepContent(inProps, ref) { | |||
transitionDuration = undefined; | |||
} | |||
|
|||
const externalForwardedProps = { | |||
slots: { transition: TransitionComponent, ...slots }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be:
slots: { transition: TransitionComponent, ...slots }, | |
slots, |
As TransitionComponent
is being passed through as
Co-authored-by: Diego Andai <[email protected]> Signed-off-by: sai chand <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @sai6855!
Part of #41281
This PR adds
slots
andslotProps
and deprecatesTransitionComponent
andTransitionProps