From 02d331b60db60db742235afa703d1475d8e8816e Mon Sep 17 00:00:00 2001 From: thinkasany <480968828@qq.com> Date: Thu, 25 Jul 2024 18:58:06 +0800 Subject: [PATCH] type: improve ts type for transfer (#50018) * type: improve ts type for transfer * revert as any * fix type --- components/transfer/ListBody.tsx | 8 ++++---- components/transfer/list.tsx | 2 +- components/transfer/search.tsx | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/components/transfer/ListBody.tsx b/components/transfer/ListBody.tsx index 4490cfbd5a..79dfa89eb0 100644 --- a/components/transfer/ListBody.tsx +++ b/components/transfer/ListBody.tsx @@ -73,11 +73,11 @@ const TransferListBody: React.ForwardRefRenderFunction< } }, [filteredRenderItems, mergedPagination, pageSize]); - const onInternalClick = (item: RecordType, e: React.MouseEvent) => { + const onInternalClick = (item: KeyWiseTransferItem, e: React.MouseEvent) => { onItemSelect(item.key, !selectedKeys.includes(item.key), e); }; - const onRemove = (item: RecordType) => { + const onRemove = (item: KeyWiseTransferItem) => { onItemRemove?.([item.key]); }; @@ -130,8 +130,8 @@ const TransferListBody: React.ForwardRefRenderFunction< renderedEl={renderedEl} prefixCls={prefixCls} showRemove={showRemove} - onClick={onInternalClick as any} - onRemove={onRemove as any} + onClick={onInternalClick} + onRemove={onRemove} checked={selectedKeys.includes(item.key)} disabled={globalDisabled || item.disabled} /> diff --git a/components/transfer/list.tsx b/components/transfer/list.tsx index ef4bc886fe..f9c92a6853 100644 --- a/components/transfer/list.tsx +++ b/components/transfer/list.tsx @@ -203,7 +203,7 @@ const TransferList = (
) => void; + onChange?: (e: React.ChangeEvent) => void; handleClear?: () => void; value?: string; disabled?: boolean;