Skip to content

Commit e870bc8

Browse files
authored
typescript - RadioGroup - support testID (#1143)
1 parent 21fcc4a commit e870bc8

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

generatedTypes/components/radioButton/RadioGroup.d.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React, { PureComponent, GetDerivedStateFromProps } from 'react';
2+
import { ViewProps } from 'react-native';
23
import { BaseComponentInjectedProps, ForwardRefInjectedProps } from '../../commons/new';
3-
export declare type RadioGroupProps = {
4+
export declare type RadioGroupProps = ViewProps & {
45
/**
56
* The initial value of the selected radio button
67
*/
@@ -31,7 +32,16 @@ declare class RadioGroup extends PureComponent<Props, RadioGroupState> {
3132
render(): JSX.Element;
3233
}
3334
export { RadioGroup };
34-
declare const _default: React.ComponentClass<RadioGroupProps & {
35+
declare const _default: React.ComponentClass<ViewProps & {
36+
/**
37+
* The initial value of the selected radio button
38+
*/
39+
initialValue?: string | number | boolean | undefined;
40+
/**
41+
* Invoked once when value changes, by selecting one of the radio buttons in the group
42+
*/
43+
onValueChange?: ((value: string) => void) | ((value: number) => void) | ((value: boolean) => void) | undefined;
44+
} & {
3545
useCustomTheme?: boolean | undefined;
3646
}, any>;
3747
export default _default;

src/components/radioButton/RadioGroup.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import _ from 'lodash';
22
import React, {PureComponent, GetDerivedStateFromProps} from 'react';
3+
import {ViewProps} from 'react-native';
34
import {
45
asBaseComponent,
56
forwardRef,
@@ -9,7 +10,7 @@ import {
910
import View from '../view';
1011
import RadioGroupContext from './RadioGroupContext';
1112

12-
export type RadioGroupProps = {
13+
export type RadioGroupProps = ViewProps & {
1314
/**
1415
* The initial value of the selected radio button
1516
*/

0 commit comments

Comments
 (0)