From eba10034a376ba7d6bfcdf555eb9dddb08809dd7 Mon Sep 17 00:00:00 2001 From: Foster Hangdaan Date: Mon, 11 Dec 2023 19:19:55 -0500 Subject: [PATCH] Add unique `key` prop for each child in a list --- _components/PostListItem.tsx | 2 +- _includes/layouts/base.tsx | 4 ++-- _includes/layouts/post.tsx | 8 ++++---- blog/index.tsx | 2 +- index.tsx | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/_components/PostListItem.tsx b/_components/PostListItem.tsx index 115adf2..3b76bd8 100644 --- a/_components/PostListItem.tsx +++ b/_components/PostListItem.tsx @@ -8,7 +8,7 @@ export default function(props: Props) { {props.post.data.title}

{props.post.data.description}

diff --git a/_includes/layouts/base.tsx b/_includes/layouts/base.tsx index fc25f56..0027283 100644 --- a/_includes/layouts/base.tsx +++ b/_includes/layouts/base.tsx @@ -11,7 +11,7 @@ export default function({ title, description, children, comp, metas, links, auth {Array.isArray(metas) && metas.length > 0 && - metas.map(m => ) + metas.map((m,index) => ) } @@ -20,7 +20,7 @@ export default function({ title, description, children, comp, metas, links, auth {Array.isArray(links) && links.length > 0 && - links.map(l => ) + links.map((l,index) => ) } diff --git a/_includes/layouts/post.tsx b/_includes/layouts/post.tsx index 9c4aad2..b89a0f6 100644 --- a/_includes/layouts/post.tsx +++ b/_includes/layouts/post.tsx @@ -7,13 +7,13 @@ export default function({ children, toc, footnotes }) {