fix(catalog): key warnings

This commit is contained in:
plebeius.eth
2023-10-21 10:24:47 +02:00
parent 0939d658a5
commit 87a019ed4f
3 changed files with 9 additions and 6 deletions
+3 -2
View File
@@ -700,8 +700,9 @@ const CatalogPost = ({ post }) => {
const CatalogRow = ({ row }) => {
const posts = [];
for (const post of row) {
posts.push(<CatalogPost key={post?.cid} post={post} />);
for (const [index, post] of row.entries()) {
const key = `${post?.cid}-${index}`;
posts.push(<CatalogPost key={key} post={post} />);
}
return <div>{posts}</div>;
};
+3 -2
View File
@@ -1122,8 +1122,9 @@ const CatalogPost = ({ post }) => {
const CatalogRow = ({ row }) => {
const posts = [];
for (const post of row) {
posts.push(<CatalogPost key={post?.cid} post={post} />);
for (const [index, post] of row.entries()) {
const key = `${post?.cid}-${index}`;
posts.push(<CatalogPost key={key} post={post} />);
}
return <div>{posts}</div>;
};
@@ -700,8 +700,9 @@ const CatalogPost = ({ post }) => {
const CatalogRow = ({ row }) => {
const posts = [];
for (const post of row) {
posts.push(<CatalogPost key={post?.cid} post={post} />);
for (const [index, post] of row.entries()) {
const key = `${post?.cid}-${index}`;
posts.push(<CatalogPost key={key} post={post} />);
}
return <div>{posts}</div>;
};