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

[OptionUnstyled] Define ownerState and slot props' types #32717

Merged
merged 3 commits into from
May 13, 2022

Conversation

michaldudak
Copy link
Member

Defined types for slots of OptionUnstyled and OptionGroupUnstyled

@michaldudak michaldudak added component: select This is the name of the generic UI component, not the React module! typescript package: base-ui Specific to @mui/base labels May 10, 2022
@michaldudak michaldudak requested a review from a team May 10, 2022 13:08
@mui-bot
Copy link

mui-bot commented May 10, 2022

Details of bundle changes

@material-ui/unstyled: parsed: -13.21% 😍, gzip: -9.20% 😍

Generated by 🚫 dangerJS against 5e173a6

@@ -41,3 +41,19 @@ export default interface OptionGroupUnstyledProps {
list?: React.ComponentPropsWithRef<'ul'> & OptionGroupUnstyledComponentsPropsOverrides;
};
}

export type OptionGroupUnstyledRootSlotProps = {
Copy link
Member

Choose a reason for hiding this comment

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

I was surprised at first that we don't have here ownerState, but saw later that we indeed don't have it for simple components :) I guess having the correct types will be helpful for developers :)

Copy link
Member Author

Choose a reason for hiding this comment

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

If developers complain about not having it, we may define type OptionGroupUnstyledOwnerState = OptionGroupUnstyledProps, and pass it to the slots, but I don't think it's necessary now.

@michaldudak michaldudak merged commit ff54d9d into mui:master May 13, 2022
@michaldudak michaldudak deleted the ownerstate-types/option branch May 13, 2022 14:14
frankkluijtmans pushed a commit to frankkluijtmans/material-ui that referenced this pull request May 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: select This is the name of the generic UI component, not the React module! package: base-ui Specific to @mui/base typescript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants