mirror of
https://github.com/apricote/Listory.git
synced 2026-01-13 21:21:02 +00:00
fix(frontend): invalid react list keys
This commit is contained in:
parent
8ecfe57661
commit
fa2d1f426f
3 changed files with 9 additions and 10 deletions
|
|
@ -59,6 +59,7 @@ export const ReportTopGenres: React.FC = () => {
|
|||
{reportHasItems &&
|
||||
topGenres.map(({ genre, artists, count }) => (
|
||||
<ReportItem
|
||||
key={genre.id}
|
||||
genre={genre}
|
||||
count={count}
|
||||
artists={artists}
|
||||
|
|
@ -79,14 +80,13 @@ const ReportItem: React.FC<{
|
|||
}> = ({ genre, artists, count, maxCount }) => {
|
||||
const artistList = artists
|
||||
.map(({ artist, count: artistCount }) => (
|
||||
<ArtistItem artist={artist} count={artistCount} />
|
||||
<ArtistItem key={artist.id} artist={artist} count={artistCount} />
|
||||
))
|
||||
// @ts-expect-error
|
||||
.reduce((acc, curr) => (acc === null ? [curr] : [acc, ", ", curr]), null);
|
||||
|
||||
return (
|
||||
<TopListItem
|
||||
key={genre.id}
|
||||
title={capitalizeString(genre.name)}
|
||||
subTitle={artistList}
|
||||
count={count}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue