-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
Conversation
Netlify deploy previewBundle size report |
@@ -249,7 +248,7 @@ const Select = React.forwardRef(function Select< | |||
)} | |||
</React.Fragment> | |||
); | |||
}) as SelectType; | |||
}) as PolymorphicComponent<SelectTypeMap<any, boolean>>; |
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.
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.
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.
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;
}
f96559c
to
5e28201
Compare
No description provided.