Skip to content

Commit

Permalink
fix(ui-react): use guaranteed value for BreadCrumbs key (#4442)
Browse files Browse the repository at this point in the history
  • Loading branch information
calebpollman authored Sep 14, 2023
1 parent 717b009 commit 7e11a3b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/modern-melons-doubt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@aws-amplify/ui-react": patch
---

fix(ui-react): use guaranteed value for BreadCrumbs key
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ export default function BreadcrumbsStyleExample() {
borderRadius="medium"
padding="medium"
>
{breadcrumbs.map(({ href, text, isCurrent }) => (
<Breadcrumbs.Item key={href}>
{breadcrumbs.map(({ href, text, isCurrent }, idx) => (
<Breadcrumbs.Item key={`${href}${idx}`}>
<Breadcrumbs.Link
fontWeight="bold"
textDecoration="underline"
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/primitives/Breadcrumbs/Breadcrumbs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const BreadcrumbsPrimitive: Primitive<BreadcrumbsProps, 'nav'> = (
{items?.map(({ href, label }, idx) => {
const isCurrent = items.length - 1 === idx;
return (
<BreadcrumbItem key={href}>
<BreadcrumbItem key={`${href}${idx}`}>
<BreadcrumbLink href={href} isCurrent={isCurrent}>
{label}
</BreadcrumbLink>
Expand Down

0 comments on commit 7e11a3b

Please sign in to comment.