Skip to content

Commit

Permalink
fix(LabelGroup): use add key to children map
Browse files Browse the repository at this point in the history
  • Loading branch information
francinelucca committed Oct 31, 2024
1 parent 760dc8e commit c9675ef
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/react/src/LabelGroup/LabelGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ const LabelGroup: React.FC<React.PropsWithChildren<LabelGroupProps>> = ({
data-index={index}
className={hiddenItemIds.includes(index.toString()) ? 'ItemWrapper--hidden' : undefined}
as={isList ? 'li' : 'span'}
key={index}
>
{child}
</ItemWrapper>
Expand Down Expand Up @@ -379,8 +380,8 @@ const LabelGroup: React.FC<React.PropsWithChildren<LabelGroupProps>> = ({
) : (
<StyledLabelGroupContainer data-overflow="inline" data-list={isList || undefined} sx={sxProp} as={as}>
{isList
? React.Children.map(children, child => {
return <li>{child}</li>
? React.Children.map(children, (child, index) => {
return <li key={index}>{child}</li>
})
: children}
</StyledLabelGroupContainer>
Expand Down

0 comments on commit c9675ef

Please sign in to comment.