Skip to content

Commit 90d96b6

Browse files
committed
feat: add key in entity mapping
1 parent 5a916f6 commit 90d96b6

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/Common/SegmentedBarChart/SegmentedBarChart.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@ const SegmentedBarChart: React.FC<SegmentedBarChartProps> = ({
4848

4949
const renderContent = () => {
5050
if (isProportional) {
51-
return filteredEntities.map((entity) => (
52-
<div className="flexbox-col">
51+
return filteredEntities.map((entity, idx) => (
52+
// eslint-disable-next-line react/no-array-index-key
53+
<div key={idx} className="flexbox-col">
5354
{renderValue(entity.value, entity.label)}
5455
<div className="flex left dc__gap-6">
5556
<span style={{ backgroundColor: entity.color }} className="h-12 dc__border-radius-2 w-4" />
@@ -58,8 +59,9 @@ const SegmentedBarChart: React.FC<SegmentedBarChartProps> = ({
5859
</div>
5960
))
6061
}
61-
return entities.map((entity) => (
62-
<div className="flexbox dc__gap-4 dc__align-items-center">
62+
return entities.map((entity, idx) => (
63+
// eslint-disable-next-line react/no-array-index-key
64+
<div key={idx} className="flexbox dc__gap-4 dc__align-items-center">
6365
<div className="dot" style={{ backgroundColor: entity.color, width: '10px', height: '10px' }} />
6466
{renderValue(entity.value, entity.label)}
6567
{renderLabel(entity.label)}

0 commit comments

Comments
 (0)