Skip to content

Commit 74604ba

Browse files
authored
fix: the key is repeated for the same content (#194)
1 parent 361f6de commit 74604ba

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/nextjs/src/components/History.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ function processItems(items: AgentInputItem[]): ProcessedItem[] {
7474
return '';
7575
})
7676
.join('\n') || '⚫︎⚫︎⚫︎',
77-
id: item.id ?? JSON.stringify(item.content),
77+
id: item.id ?? '',
7878
});
7979
}
8080
}
@@ -100,7 +100,7 @@ export function History({ history }: HistoryProps) {
100100
<TextMessage
101101
text={item.content}
102102
isUser={item.role === 'user'}
103-
key={item.id ?? idx}
103+
key={item.id || idx}
104104
/>
105105
);
106106
}

0 commit comments

Comments
 (0)