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 706100ccce
commit 619d2771cc
7 changed files with 80 additions and 80 deletions
+19 -19
View File
@@ -7,28 +7,28 @@ import RecentPosts from '../components/recent-posts';
import RootInfo from '../public/home.json';
function Nav() {
const nav = Object.entries(RootInfo);
return (
<div className='block'>
<h2>Navigation</h2>
{
nav.map(([slug, info], i) => {
return <Link key={i} href={slug} className='button green'>{info.title}</Link>
})
}
</div>
)
const nav = Object.entries(RootInfo);
return (
<div className='block'>
<h2>Navigation</h2>
{
nav.map(([slug, info]) => {
return <Link key={slug} href={slug} className='button green'>{info.title}</Link>
})
}
</div>
)
}
function HomePage() {
return (
<Layout>
<QuickLinks />
<RecentPosts />
<RecentNotes />
<Nav />
</Layout>
)
return (
<Layout>
<QuickLinks />
<RecentPosts />
<RecentNotes />
<Nav />
</Layout>
)
}
export default HomePage;