Skip to content

Commit ad27cd5

Browse files
authored
change onValueChange type (#974)
1 parent e16c266 commit ad27cd5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

generatedTypes/components/radioButton/RadioGroup.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export declare type RadioGroupPropTypes = {
88
/**
99
* Invoked once when value changes, by selecting one of the radio buttons in the group
1010
*/
11-
onValueChange?: (value: string | number | boolean) => void;
11+
onValueChange?: ((value: string) => void) | ((value: number) => void) | ((value: boolean) => void);
1212
};
1313
interface RadioGroupState {
1414
value?: RadioGroupPropTypes['initialValue'];
@@ -30,7 +30,7 @@ declare class RadioGroup extends PureComponent<Props, RadioGroupState> {
3030
render(): JSX.Element;
3131
}
3232
export { RadioGroup };
33-
declare const _default: React.ComponentClass<{
33+
declare const _default: React.ComponentClass<RadioGroupPropTypes & {
3434
useCustomTheme?: boolean | undefined;
3535
}, any>;
3636
export default _default;

src/components/radioButton/RadioGroup.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export type RadioGroupPropTypes = {
1717
/**
1818
* Invoked once when value changes, by selecting one of the radio buttons in the group
1919
*/
20-
onValueChange?: (value: string | number | boolean) => void;
20+
onValueChange?: ((value: string) => void) | ((value: number) => void) | ((value: boolean) => void);
2121
};
2222

2323
interface RadioGroupState {
@@ -85,4 +85,4 @@ class RadioGroup extends PureComponent<Props, RadioGroupState> {
8585

8686
export {RadioGroup}; // For tests
8787

88-
export default asBaseComponent(forwardRef(RadioGroup));
88+
export default asBaseComponent<RadioGroupPropTypes>(forwardRef(RadioGroup));

0 commit comments

Comments
 (0)