mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 23:07:06 +00:00
Use namespaces
This commit is contained in:
Vendored
+13
-11
@@ -6,17 +6,19 @@
|
||||
|
||||
import * as React from 'react';
|
||||
|
||||
export type Value = React.InputHTMLAttributes<HTMLInputElement>['value'];
|
||||
type Value = React.InputHTMLAttributes<HTMLInputElement>['value'];
|
||||
|
||||
export type RadioProps = React.InputHTMLAttributes<HTMLInputElement>;
|
||||
|
||||
export const Radio: React.ComponentClass<RadioProps>;
|
||||
|
||||
export interface RadioGroupProps {
|
||||
name?: string;
|
||||
selectedValue?: Value;
|
||||
onChange?: (value: Value) => void;
|
||||
Component?: string | React.ReactElement<React.HTMLProps<HTMLElement>>;
|
||||
export namespace Radio {
|
||||
export type RadioProps = React.InputHTMLAttributes<HTMLInputElement>;
|
||||
}
|
||||
export const Radio: React.ComponentClass<Radio.RadioProps>;
|
||||
|
||||
export const RadioGroup: React.ComponentClass<RadioGroupProps>;
|
||||
export namespace RadioGroup {
|
||||
export interface RadioGroupProps {
|
||||
name?: string;
|
||||
selectedValue?: Value;
|
||||
onChange?: (value: Value) => void;
|
||||
Component?: string | React.ReactElement<React.HTMLProps<HTMLElement>>;
|
||||
}
|
||||
}
|
||||
export const RadioGroup: React.ComponentClass<RadioGroup.RadioGroupProps>;
|
||||
|
||||
@@ -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<RadioGroupProps> {
|
||||
constructor(props: RadioGroupProps) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
handleChange(value: Value) {
|
||||
class ReactRadioGroup extends React.Component<RadioGroup.RadioGroupProps> {
|
||||
handleChange: RadioGroup.RadioGroupProps['onChange'] = value => {
|
||||
console.log(value);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user