From 4b20bf755672680faa7e0df1a3cc32f542807e07 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Mon, 25 Sep 2023 15:07:32 +0800 Subject: [PATCH] fix: repeated element key --- src/components/ui/Skeleton.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/ui/Skeleton.tsx b/src/components/ui/Skeleton.tsx index acb79ba7..a13ab98c 100644 --- a/src/components/ui/Skeleton.tsx +++ b/src/components/ui/Skeleton.tsx @@ -50,9 +50,9 @@ function Container({
{Array.from(new Array(count)).map((_, index) => ( - {childrenArray.map((child) => + {childrenArray.map((child, i) => React.cloneElement(child as React.ReactElement, { - key: index, + key: `child-${index}-${i}`, }), )}