Library
React Components / v9 (@fluentui/react-components)
System Info
Are you reporting Accessibility issue?
no
Reproduction
Bug Description
Actual Behavior
RadioProps types onChange as it has two arguments:
onChange?: (ev: React.ChangeEvent<HTMLInputElement>, data: RadioOnChangeData) => void;
As the RadioProps is intersection of ComponentProps<..., 'input'> it does not allow the data argument:
TS2322: Type '(e: ChangeEvent<HTMLInputElement>, d: RadioOnChangeData) => void' is not assignable to type 'ChangeEventHandler<HTMLInputElement> & ((ev: ChangeEvent<HTMLInputElement>, data: RadioOnChangeData) => void)'. Type '(e: ChangeEvent<HTMLInputElement>, d: RadioOnChangeData) => void' is not assignable to type 'ChangeEventHandler<HTMLInputElement>'. index.d.ts(2217, 9): The expected type comes from property 'onChange' which is declared here on type 'IntrinsicAttributes & Omit<ComponentProps<Partial<RadioSlots>, "input">, "size"> & { value?: string | undefined; labelPosition?: "after" | ... 1 more ... | undefined; disabled?: boolean | undefined; onChange?: ((ev: ChangeEvent<...>, data: RadioOnChangeData) => void) | undefined; } & RefAttributes<...>'
Expected Behavior
data argument is valid on onChange
Logs
No response
Requested priority
Normal
Products/sites affected
No response
Are you willing to submit a PR to fix?
yes
Validations
Library
React Components / v9 (@fluentui/react-components)
System Info
Are you reporting Accessibility issue?
no
Reproduction
Bug Description
Actual Behavior
RadioPropstypesonChangeas it has two arguments:As the
RadioPropsis intersection ofComponentProps<..., 'input'>it does not allow thedataargument:Expected Behavior
dataargument is valid ononChangeLogs
No response
Requested priority
Normal
Products/sites affected
No response
Are you willing to submit a PR to fix?
yes
Validations