From 641fe386675999c9632ab4eac80d280c13ae61c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=BB=BA=E5=B3=B0?= <645381995@qq.com> Date: Tue, 8 Nov 2022 14:41:34 +0800 Subject: [PATCH] feat: remove old key --- components/list/index.tsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/components/list/index.tsx b/components/list/index.tsx index f0b945a086d4..c98310c3937a 100644 --- a/components/list/index.tsx +++ b/components/list/index.tsx @@ -104,8 +104,6 @@ function List({ total: 0, }; - const listItemsKeys: { [index: number]: React.Key } = {}; - const triggerPaginationEvent = (eventName: string) => (page: number, pageSize: number) => { setPaginationCurrent(page); setPaginationSize(pageSize); @@ -135,8 +133,6 @@ function List({ key = `list-item-${index}`; } - listItemsKeys[index] = key; - return {renderItem(item, index)}; }; @@ -249,8 +245,8 @@ function List({ let childrenContent = isLoading &&
; if (splitDataSource.length > 0) { const items = splitDataSource.map((item: T, index: number) => renderInnerItem(item, index)); - const childrenList = React.Children.map(items, (child: React.ReactNode, index: number) => ( -
+ const childrenList = React.Children.map(items, child => ( +
{child}
));