mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-16 20:12:22 +03:00
Fix React "unique key prop" warning
This commit is contained in:
parent
a3eb14d7f4
commit
e79922def1
@ -81,13 +81,13 @@ const AlbumComment = ({ record }) => {
|
||||
const [expanded, setExpanded] = React.useState(false)
|
||||
|
||||
const formatted = useMemo(() => {
|
||||
return record.comment.split('\n').map((line) => (
|
||||
<>
|
||||
return record.comment.split('\n').map((line, idx) => (
|
||||
<span key={record.id + '-comment-' + idx}>
|
||||
{line}
|
||||
<br />
|
||||
</>
|
||||
</span>
|
||||
))
|
||||
}, [record.comment])
|
||||
}, [record.comment, record.id])
|
||||
|
||||
const handleExpandClick = useCallback(() => {
|
||||
setExpanded(!expanded)
|
||||
|
Loading…
x
Reference in New Issue
Block a user