Skip to content

Commit

Permalink
fix(admin-ui->Collections): add key for map fn. resolve #6106 (#6107)
Browse files Browse the repository at this point in the history
resolve #6106.


just add key for map fn.
  • Loading branch information
wangjue666 authored Jan 18, 2024
1 parent e49b694 commit 2cca362
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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>
) : (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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>
)}
Expand Down

0 comments on commit 2cca362

Please sign in to comment.