diff --git a/types/react-radio-group/index.d.ts b/types/react-radio-group/index.d.ts index 9628561b61..3dfa872527 100644 --- a/types/react-radio-group/index.d.ts +++ b/types/react-radio-group/index.d.ts @@ -6,17 +6,19 @@ import * as React from 'react'; -export type Value = React.InputHTMLAttributes['value']; +type Value = React.InputHTMLAttributes['value']; -export type RadioProps = React.InputHTMLAttributes; - -export const Radio: React.ComponentClass; - -export interface RadioGroupProps { - name?: string; - selectedValue?: Value; - onChange?: (value: Value) => void; - Component?: string | React.ReactElement>; +export namespace Radio { + export type RadioProps = React.InputHTMLAttributes; } +export const Radio: React.ComponentClass; -export const RadioGroup: React.ComponentClass; +export namespace RadioGroup { + export interface RadioGroupProps { + name?: string; + selectedValue?: Value; + onChange?: (value: Value) => void; + Component?: string | React.ReactElement>; + } +} +export const RadioGroup: React.ComponentClass; diff --git a/types/react-radio-group/react-radio-group-tests.tsx b/types/react-radio-group/react-radio-group-tests.tsx index 65cd53fab3..76e093059b 100644 --- a/types/react-radio-group/react-radio-group-tests.tsx +++ b/types/react-radio-group/react-radio-group-tests.tsx @@ -1,12 +1,8 @@ import * as React from 'react'; -import { Radio, RadioGroup, RadioGroupProps, Value } from "react-radio-group"; +import { Radio, RadioGroup } from "react-radio-group"; -class ReactRadioGroup extends React.Component { - constructor(props: RadioGroupProps) { - super(props); - } - - handleChange(value: Value) { +class ReactRadioGroup extends React.Component { + handleChange: RadioGroup.RadioGroupProps['onChange'] = value => { console.log(value); }