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

[Select][base] Drop component prop #37035

Merged
merged 10 commits into from Apr 30, 2023
Merged

Conversation

hbjORbj
Copy link
Member

@hbjORbj hbjORbj commented Apr 26, 2023

No description provided.

@hbjORbj hbjORbj added breaking change component: select This is the name of the generic UI component, not the React module! package: base-ui Specific to @mui/base labels Apr 26, 2023
@hbjORbj hbjORbj self-assigned this Apr 26, 2023
@mui-bot
Copy link

mui-bot commented Apr 26, 2023

Netlify deploy preview

Bundle size report

Details of bundle changes

Generated by 🚫 dangerJS against 8c9085c

@@ -249,7 +248,7 @@ const Select = React.forwardRef(function Select<
)}
</React.Fragment>
);
}) as SelectType;
}) as PolymorphicComponent<SelectTypeMap<any, boolean>>;
Copy link
Member

Choose a reason for hiding this comment

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

Select is a special case as it has generic props. It should not be cast to PolymorphicComponent, but remain SelectType. Then, the SelectType should be adjusted to match the shape of PolymorphicComponent but with a generic parameter.

Copy link
Member Author

Choose a reason for hiding this comment

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

Does this seem correct?

export interface SelectType {
  <
    OptionValue extends {},
    RootComponentType extends React.ElementType,
    Multiple extends boolean = false,
  >(
    props: PolymorphicProps<SelectTypeMap<OptionValue, Multiple>, RootComponentType>,
  ): JSX.Element | null;
  propTypes?: any;
  displayName?: string | undefined;
}

@hbjORbj hbjORbj merged commit 22b7f0c into mui:master Apr 30, 2023
21 checks passed
binh1298 pushed a commit to binh1298/material-ui that referenced this pull request May 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change component: select This is the name of the generic UI component, not the React module! package: base-ui Specific to @mui/base
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants