-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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-next][ButtonGroup] Change ButtonGroup
files to ts
#39794
[material-next][ButtonGroup] Change ButtonGroup
files to ts
#39794
Conversation
Netlify deploy previewhttps://deploy-preview-39794--material-ui.netlify.app/ Bundle size reportDetails of bundle changes (Toolpad) |
@mnajdova I have changed the type for the OwnerState so far. We should try to adopt this way for the other components in |
@mnajdova @mj12albert We could also consider introducing a new type in @mui/types to make it easier to create the OwnerState types. An example of this would be: type PickRequired<T, K extends keyof T> = DistributiveOmit<T, K> & {
[P in K]-?: T[P];
}; We could introduce this in this PR or in a separate one. Then we could use this type as follows: import { PickRequired } from '@mui/types'
export interface ButtonGroupOwnerState
extends PickRequired<ButtonGroupProps,
| 'color'
| 'disabled'
| 'disableElevation'
| 'disableRipple'
| 'disableTouchRipple'
| 'fullWidth'
| 'orientation'
| 'size'
| 'variant'
> {} |
I agree this could be helpful, we could discuss and refine in a separate issue CC @DiegoAndai We've actually kind of started making OwnerState types with Omit/Required/Pick here and there already 😅 e.g. |
The types look good to me 👍 I will let @DiegoAndai chime in and let his opinion lastly before we merge this. Thanks a lot for the effort @lhilgert9 🙏 |
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 looks good to me 🎉
The utility type for the owner state also makes sense to me. Left a comment on that issue.
Should we merge this @mnajdova? Go ahead if you think we should, just asking as you were reviewing it originally.
@DiegoAndai @mnajdova OwnerState type is now also fixed. Now everything should be ready in this PR to merge. |
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.
Sorry for the delay, let's udpate to matest master and merge 👍
@mnajdova Done👍🏽 |
ButtonGroup issue: #39686
Material You umbrella issue: #29345
Changes
ButtonGroup
files to TS