fix(admin-ui->Collections): add key for map fn. resolve #6106 (#6107)

resolve #6106.


just add key for map fn.
This commit is contained in:
invalid w
2024-01-18 14:32:45 +00:00
committed by GitHub
parent e49b6944e3
commit 2cca3627c3
2 changed files with 5 additions and 4 deletions
@@ -78,7 +78,7 @@ const Table = React.forwardRef<HTMLTableElement, TableProps>(
{filteringOptions ? (
<div className="mb-2 flex self-end">
{Array.isArray(filteringOptions)
? filteringOptions.map((fo) => <FilteringOptions {...fo} />)
? filteringOptions.map((fo, idx) => <FilteringOptions {...fo} key={idx} />)
: filteringOptions}
</div>
) : (
@@ -133,10 +133,11 @@ const CollectionsTable: React.FC = () => {
<Table.Head>
{headerGroups?.map((headerGroup) => (
<Table.HeadRow {...headerGroup.getHeaderGroupProps()}>
{headerGroup.headers.map((col) => (
{headerGroup.headers.map((col, idx) => (
<Table.HeadCell
className="min-w-[100px]"
{...col.getHeaderProps()}
key={idx}
>
{col.render("Header")}
</Table.HeadCell>
@@ -156,9 +157,9 @@ const CollectionsTable: React.FC = () => {
</Table.Body>
) : (
<Table.Body {...getTableBodyProps()}>
{rows.map((row) => {
{rows.map((row, idx) => {
prepareRow(row)
return <CollectionRow row={row} />
return <CollectionRow row={row} key={idx} />
})}
</Table.Body>
)}