react: fix incorrect use of keys

Signed-off-by: Paul W. <lambdapaul@protonmail.com>
This commit is contained in:
2024-12-06 13:52:40 -05:00
parent 4f25a3bc3d
commit ff03bd50ff
7 changed files with 80 additions and 80 deletions

View File

@@ -26,8 +26,8 @@ function Posts() {
<table>
<tbody>
{
posts.map(([slug, post]: any, i: number) => {
return <tr key={i} style={{ alignItems: 'center' }}>
posts.map(([slug, post]: [string, any]) => {
return <tr key={slug} style={{ alignItems: 'center' }}>
<td style={{ display: 'inline-block', textAlign: 'right', fontSize: '0.9rem' }}>
<div style={{ fontStyle: 'italics', fontSize: '.8rem' }}>{
post.mtime && (post.mtime != post.otime) && `Updated ${date.toRelativeDate(new Date(post.mtime))}`