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

[Button] Fix regression from context API #29982

Merged
merged 7 commits into from
Dec 3, 2021

Conversation

siriwatknp
Copy link
Member

@siriwatknp siriwatknp commented Dec 1, 2021

close #29741
close #29598
(PR) close #29613

summary

  • add low level mergeProps that is similar to useThemeProps to combine props
  • merge the context props with props before the theme default props. the priority is inProps > contextProps > themeDefaultProps.
    the code to look similar to the code before the regression (except className that is added because of the context props).
    image
  • add tests to cover the regression

@mui-pr-bot
Copy link

mui-pr-bot commented Dec 1, 2021

Details of bundle changes

Generated by 🚫 dangerJS against 2ec7ff4

@siriwatknp
Copy link
Member Author

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.

It's much cleaner. Could you take a look at the comments?

packages/mui-material/src/Button/Button.js Show resolved Hide resolved
packages/mui-utils/src/mergeProps.ts Outdated Show resolved Hide resolved
@siriwatknp siriwatknp force-pushed the fix/button-regression branch from 7b7b26e to 2ec7ff4 Compare December 2, 2021 08:41
@siriwatknp siriwatknp requested a review from mnajdova December 2, 2021 08:42
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.

👌

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.

Nice, thanks 👍

@siriwatknp siriwatknp merged commit a239b7f into mui:master Dec 3, 2021
@siriwatknp siriwatknp deleted the fix/button-regression branch December 3, 2021 12:48
@zannager zannager added the component: button This is the name of the generic UI component, not the React module! label Jan 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: button This is the name of the generic UI component, not the React module!
Projects
None yet
5 participants