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

[Transition] Add sx prop type #32025

Closed
wants to merge 1 commit into from
Closed

[Transition] Add sx prop type #32025

wants to merge 1 commit into from

Conversation

cvanem
Copy link
Contributor

@cvanem cvanem commented Mar 28, 2022

No description provided.

Copy link
Contributor

@ivan-ngchakming ivan-ngchakming left a comment

Choose a reason for hiding this comment

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

Hello, I think you forgot to run yarn proptypes to add the sx props to Slide's proptypes.
I believe you also need to regenerate the docs using yarn docs:api too.

Copy link
Member

@mnajdova mnajdova left a comment

Choose a reason for hiding this comment

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

The transition components does not support the sx prop. The sx prop should be used in the inner component (the component they wrap and add the transition).

If this is not clear, maybe we can re-purpose the PR to update the documentation to state this.

@cvanem
Copy link
Contributor Author

cvanem commented Mar 29, 2022

The transition components does not support the sx prop. The sx prop should be used in the inner component (the component they wrap and add the transition).

If this is not clear, maybe we can re-purpose the PR to update the documentation to state this.

@mnajdova This makes sense, however here is the source of confusion from my end:

  1. The sx prop does appear to work on the Slide component, but only because the Transition component passes it to the children.

  2. The Collapse component supports the sx prop and also uses the Transition component. It passes remaining props to it's children in a manner similar to the Slide component (via the Transition component).

Not sure what the best approach would be, but there does seem to be some inconsistency in the way the sx prop is handled with regards to the Collapse and Slide components. Is there a functional difference I am not seeing?

@danilo-leal danilo-leal added the component: slider This is the name of the generic UI component, not the React module! label Mar 30, 2022
@siriwatknp siriwatknp added component: transitions This is the name of the generic UI component, not the React module! and removed component: slider This is the name of the generic UI component, not the React module! labels Mar 31, 2022
@danilo-leal danilo-leal changed the title [Slide] Add sx prop type [Transition] Add sx prop type Apr 1, 2022
@mnajdova
Copy link
Member

@cvanem I guess you meant the Slide, not Slider based on your comment :) I wouldn't add the sx prop in any of the transition components' props, as these components may be used with non Material UI components that do not support this prop. Regarding how props are propagated from the tranistion components I would assume that always the rest of the props that are not handled are going to be propagated to the children element.

So in conclusion, I would remove the sx prop the tranistion props, for example from the Collapse component, instead of adding it to other tranisiton components. However, this would be a breaking change, so I would propose we move this to our v6 milestone. I hope this clarifies the confusion.

@mnajdova mnajdova mentioned this pull request May 18, 2022
2 tasks
@mnajdova
Copy link
Member

I've added this in #30660, I propose we close this PR and open a new one for removing the sx prop once we start to work on the breaking changes for v6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: transitions This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants