mirror of
https://github.com/JefferyHcool/BiliNote.git
synced 2026-05-07 08:03:09 +08:00
fix: 修复NoteHistory组件中的key警告
修复React警告"Each child in a list should have a unique 'key' prop"
This commit is contained in:
@@ -77,16 +77,15 @@ const NoteHistory: FC<NoteHistoryProps> = ({ onSelect, selectedId }) => {
|
||||
<div className="flex flex-col gap-2 overflow-hidden">
|
||||
{filteredTasks.map(task => (
|
||||
<div
|
||||
onClick={() => onSelect(task.id)}
|
||||
key={task.id}
|
||||
onClick={() => onSelect(task.id)}
|
||||
className={cn(
|
||||
'flex cursor-pointer flex-col rounded-md border border-neutral-200 p-3',
|
||||
selectedId === task.id && 'border-primary bg-primary-light'
|
||||
)}
|
||||
>
|
||||
<div
|
||||
key={task.id}
|
||||
className={cn('flex items-center gap-4')}
|
||||
|
||||
>
|
||||
{/* 封面图 */}
|
||||
{task.platform === 'local' ? (
|
||||
|
||||
Reference in New Issue
Block a user