From 473872af66dc1fcffeb6177713d0e7d31d773de8 Mon Sep 17 00:00:00 2001 From: Wei Zhu Date: Thu, 8 Mar 2018 21:42:22 +0800 Subject: [PATCH] Remove AbstractCheckboxChangeEvent, fix TS4029 error See https://github.com/Microsoft/TypeScript/issues/9944 --- components/checkbox/Checkbox.tsx | 14 ++++++-------- components/radio/interface.tsx | 9 +++++++-- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/components/checkbox/Checkbox.tsx b/components/checkbox/Checkbox.tsx index db6adf028a..674939d023 100644 --- a/components/checkbox/Checkbox.tsx +++ b/components/checkbox/Checkbox.tsx @@ -27,18 +27,16 @@ export interface CheckboxProps extends AbstractCheckboxProps { - target: T; - stopPropagation: () => void; - preventDefault: () => void; - nativeEvent: MouseEvent; -} - export interface CheckboxChangeEventTarget extends CheckboxProps { checked: boolean; } -export type CheckboxChangeEvent = AbstractCheckboxChangeEvent; +export interface CheckboxChangeEvent { + target: CheckboxChangeEventTarget; + stopPropagation: () => void; + preventDefault: () => void; + nativeEvent: MouseEvent; +} export default class Checkbox extends React.Component { static Group: typeof CheckboxGroup; diff --git a/components/radio/interface.tsx b/components/radio/interface.tsx index 2840dc2913..81e04ca216 100644 --- a/components/radio/interface.tsx +++ b/components/radio/interface.tsx @@ -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; +export interface RadioChangeEvent { + target: RadioChangeEventTarget; + stopPropagation: () => void; + preventDefault: () => void; + nativeEvent: MouseEvent; +}