Fix React "unique key prop" warning
This commit is contained in:
parent
a3eb14d7f4
commit
e79922def1
1 changed files with 4 additions and 4 deletions
|
|
@ -81,13 +81,13 @@ const AlbumComment = ({ record }) => {
|
||||||
const [expanded, setExpanded] = React.useState(false)
|
const [expanded, setExpanded] = React.useState(false)
|
||||||
|
|
||||||
const formatted = useMemo(() => {
|
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}
|
{line}
|
||||||
<br />
|
<br />
|
||||||
</>
|
</span>
|
||||||
))
|
))
|
||||||
}, [record.comment])
|
}, [record.comment, record.id])
|
||||||
|
|
||||||
const handleExpandClick = useCallback(() => {
|
const handleExpandClick = useCallback(() => {
|
||||||
setExpanded(!expanded)
|
setExpanded(!expanded)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue