Remove AbstractCheckboxChangeEvent, fix TS4029 error

See https://github.com/Microsoft/TypeScript/issues/9944
pull/9579/head
Wei Zhu 7 years ago
parent f78e0098fa
commit 473872af66

@ -27,18 +27,16 @@ export interface CheckboxProps extends AbstractCheckboxProps<CheckboxChangeEvent
indeterminate?: boolean;
}
export interface AbstractCheckboxChangeEvent<T> {
target: T;
stopPropagation: () => void;
preventDefault: () => void;
nativeEvent: MouseEvent;
}
export interface CheckboxChangeEventTarget extends CheckboxProps {
checked: boolean;
}
export type CheckboxChangeEvent = AbstractCheckboxChangeEvent<CheckboxChangeEventTarget>;
export interface CheckboxChangeEvent {
target: CheckboxChangeEventTarget;
stopPropagation: () => void;
preventDefault: () => void;
nativeEvent: MouseEvent;
}
export default class Checkbox extends React.Component<CheckboxProps, {}> {
static Group: typeof CheckboxGroup;

@ -1,6 +1,6 @@
import * as React from 'react';
import { AbstractCheckboxGroupProps } from '../checkbox/Group';
import { AbstractCheckboxProps, AbstractCheckboxChangeEvent } from '../checkbox/Checkbox';
import { AbstractCheckboxProps } from '../checkbox/Checkbox';
export interface RadioGroupProps extends AbstractCheckboxGroupProps {
defaultValue?: any;
@ -33,4 +33,9 @@ export interface RadioChangeEventTarget extends RadioProps {
checked: boolean;
}
export type RadioChangeEvent = AbstractCheckboxChangeEvent<RadioChangeEventTarget>;
export interface RadioChangeEvent {
target: RadioChangeEventTarget;
stopPropagation: () => void;
preventDefault: () => void;
nativeEvent: MouseEvent;
}

Loading…
Cancel
Save