Skip to content

Commit 7f17491

Browse files
committed
use Fragment component to declare the key for each item
1 parent 29f5f48 commit 7f17491

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/components/Breadcrumbs/index.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Fragment } from "react"
12
import { useRouter } from "next/router"
23
import { useTranslation } from "next-i18next"
34

@@ -72,8 +73,8 @@ const Breadcrumbs = ({ slug, startDepth = 0, ...props }: BreadcrumbsProps) => {
7273
const normalizePath = (path) => path.replace(/\/$/, "") // Remove trailing slash
7374
const isCurrentPage = normalizePath(slug) === normalizePath(fullPath)
7475
return (
75-
<>
76-
<BreadcrumbItem key={fullPath}>
76+
<Fragment key={fullPath}>
77+
<BreadcrumbItem>
7778
{isCurrentPage ? (
7879
<BreadcrumbPage>{text}</BreadcrumbPage>
7980
) : (
@@ -85,7 +86,7 @@ const Breadcrumbs = ({ slug, startDepth = 0, ...props }: BreadcrumbsProps) => {
8586
/
8687
</BreadcrumbSeparator>
8788
)}
88-
</>
89+
</Fragment>
8990
)
9091
})}
9192
</BreadcrumbList>

0 commit comments

Comments
 (0)