From 2cca3627c32bdcc314889b966900db480a83a8f3 Mon Sep 17 00:00:00 2001 From: invalid w Date: Thu, 18 Jan 2024 22:32:45 +0800 Subject: [PATCH] fix(admin-ui->Collections): add key for map fn. resolve #6106 (#6107) resolve #6106. just add key for map fn. --- .../admin-ui/ui/src/components/molecules/table/index.tsx | 2 +- .../src/components/templates/collections-table/index.tsx | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/admin-ui/ui/src/components/molecules/table/index.tsx b/packages/admin-ui/ui/src/components/molecules/table/index.tsx index affcfe3add..5b926de7cf 100644 --- a/packages/admin-ui/ui/src/components/molecules/table/index.tsx +++ b/packages/admin-ui/ui/src/components/molecules/table/index.tsx @@ -78,7 +78,7 @@ const Table = React.forwardRef( {filteringOptions ? (
{Array.isArray(filteringOptions) - ? filteringOptions.map((fo) => ) + ? filteringOptions.map((fo, idx) => ) : filteringOptions}
) : ( diff --git a/packages/admin-ui/ui/src/components/templates/collections-table/index.tsx b/packages/admin-ui/ui/src/components/templates/collections-table/index.tsx index 616f591c37..592c0d9641 100644 --- a/packages/admin-ui/ui/src/components/templates/collections-table/index.tsx +++ b/packages/admin-ui/ui/src/components/templates/collections-table/index.tsx @@ -133,10 +133,11 @@ const CollectionsTable: React.FC = () => { {headerGroups?.map((headerGroup) => ( - {headerGroup.headers.map((col) => ( + {headerGroup.headers.map((col, idx) => ( {col.render("Header")} @@ -156,9 +157,9 @@ const CollectionsTable: React.FC = () => { ) : ( - {rows.map((row) => { + {rows.map((row, idx) => { prepareRow(row) - return + return })} )}