-
Notifications
You must be signed in to change notification settings - Fork 90
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
feat(RadioButton): allow an extended value other than a string #1177
Conversation
Playwright Test Component is ready. |
Preview is ready. |
Motivation: to support enums
|
may be even |
type RadioButtonComponentType = (<T extends string>( | ||
props: RadioButtonProps<T> & {ref?: React.ForwardedRef<HTMLDivElement>}, | ||
) => React.JSX.Element) & { |
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.
I do not know how to write like this
<T extends string>React.ForwardRefExoticComponent<
RadioButtonProps<T> & React.RefAttributes<HTMLDivElement>
>
Ts does not allow
@@ -67,7 +69,7 @@ export function useRadioGroup(props: UseRadioGroupProps): UseRadioGroupResult { | |||
|
|||
const optionsProps = options.map((option) => ({ | |||
name: name || controlId, | |||
value: String(option.value), |
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.
I did not understand why - type option.value === 'string'
already
No description provided.