fix(frontend): invalid react list keys

This commit is contained in:
Julian Tölle 2022-06-25 17:17:32 +02:00
parent 8ecfe57661
commit fa2d1f426f
3 changed files with 9 additions and 10 deletions

View file

@ -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}