-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
Description
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
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- The provided reproduction is a minimal reproducible example of the bug.
Reactions are currently unavailable