Skip to content

Commit f426c43

Browse files
authored
fix(issues): Fix react key warning in grouping component (#101224)
the duplicate was usually 'exception'
1 parent 6075243 commit f426c43

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

static/app/components/events/groupingInfo/groupingComponentChildren.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@ function GroupingComponentChildren({component, showNonContributing}: Props) {
1919
<Fragment>
2020
{component.values
2121
.filter((value: any) => groupingComponentFilter(value, showNonContributing))
22-
.map((value: any) => (
23-
<GroupingComponentListItem key={typeof value === 'object' ? value.id : value}>
22+
.map((value: any, index: number) => (
23+
<GroupingComponentListItem
24+
// value.id is not a unique value
25+
key={typeof value === 'object' ? `${value.id}-${index}` : `${value}-${index}`}
26+
>
2427
{typeof value === 'object' ? (
2528
<GroupingComponent
2629
component={value}

0 commit comments

Comments
 (0)