Skip to content

Commit cd5cbaf

Browse files
Ed Mooreafc163
authored andcommitted
Fix types for Radio Group
1 parent 007c7d0 commit cd5cbaf

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

components/radio/group.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
33
import classNames from 'classnames';
44
import shallowEqual from 'shallowequal';
55
import Radio from './radio';
6-
import { RadioGroupProps, RadioGroupState, RadioChangeEvent } from './interface';
6+
import { RadioGroupProps, RadioGroupState, RadioChangeEvent, RadioGroupButtonStyle } from './interface';
77

88
function getCheckedValue(children: React.ReactNode) {
99
let value = null;
@@ -21,7 +21,7 @@ export default class RadioGroup extends React.Component<RadioGroupProps, RadioGr
2121
static defaultProps = {
2222
disabled: false,
2323
prefixCls: 'ant-radio',
24-
buttonStyle: 'outline',
24+
buttonStyle: 'outline' as RadioGroupButtonStyle,
2525
};
2626

2727
static childContextTypes = {

components/radio/interface.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import * as React from 'react';
22
import { AbstractCheckboxGroupProps } from '../checkbox/Group';
33
import { AbstractCheckboxProps } from '../checkbox/Checkbox';
44

5+
export type RadioGroupButtonStyle = 'outline' | 'solid';
6+
57
export interface RadioGroupProps extends AbstractCheckboxGroupProps {
68
defaultValue?: any;
79
value?: any;
@@ -12,7 +14,7 @@ export interface RadioGroupProps extends AbstractCheckboxGroupProps {
1214
name?: string;
1315
children?: React.ReactNode;
1416
id?: string;
15-
buttonStyle?: 'outline' | 'solid';
17+
buttonStyle?: RadioGroupButtonStyle;
1618
}
1719

1820
export interface RadioGroupState {

0 commit comments

Comments
 (0)