From c22beab7c7a54787ea4dd40306ef82115274b2b6 Mon Sep 17 00:00:00 2001 From: zombiej Date: Tue, 15 Mar 2022 10:24:49 +0800 Subject: [PATCH] fix: onSelect & onDeSelect type --- src/Select.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Select.tsx b/src/Select.tsx index 72c33317a..391f8e976 100644 --- a/src/Select.tsx +++ b/src/Select.tsx @@ -95,6 +95,8 @@ export type SelectHandler void) | ((value: ValueType, option: OptionType) => void); +type ArrayElementType = T extends (infer E)[] ? E : T; + export interface SelectProps extends BaseSelectPropsWithoutPrivate { prefixCls?: string; @@ -113,8 +115,8 @@ export interface SelectProps>> Select - onSelect?: SelectHandler; - onDeselect?: SelectHandler; + onSelect?: SelectHandler, OptionType>; + onDeselect?: SelectHandler, OptionType>; // >>> Options /**