From bad2b39f6432950175646c5c4b71b7e0754a430d Mon Sep 17 00:00:00 2001 From: MadCcc <1075746765@qq.com> Date: Thu, 6 Jan 2022 10:19:06 +0800 Subject: [PATCH] fix: fix onSelect type definition --- src/Select.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Select.tsx b/src/Select.tsx index 14861395e..93aaf213f 100644 --- a/src/Select.tsx +++ b/src/Select.tsx @@ -91,6 +91,10 @@ export interface DefaultOptionType extends BaseOptionType { children?: Omit[]; } +export type SelectHandler = + | ((value: RawValueType | LabelInValueType, option: OptionType) => void) + | ((value: ValueType, option: OptionType) => void); + export interface SelectProps extends BaseSelectPropsWithoutPrivate { prefixCls?: string; @@ -109,8 +113,8 @@ export interface SelectProps>> Select - onSelect?: (value: RawValueType | LabelInValueType, option: OptionType) => void; - onDeselect?: (value: RawValueType | LabelInValueType, option: OptionType) => void; + onSelect?: SelectHandler; + onDeselect?: SelectHandler; // >>> Options /**