Skip to content

Commit

Permalink
fix: duplicate keys in LegendCategories. (#220)
Browse files Browse the repository at this point in the history
fix-219
  • Loading branch information
andyFang94 authored Jun 7, 2024
1 parent a6265a5 commit 0bb09a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/Legend/LegendCategories/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function LegendCategories(props: LegendCategoriesProps) {
return (
<div className={classnames(CLS_PREFIX, cls_name)} style={style}>
{labels.map((item, index) => (
<div className={`${CLS_PREFIX}__content`} key={item}>
<div className={`${CLS_PREFIX}__content`} key={`${item}__${color[index]}__${index}`}>

Check warning on line 20 in src/components/Legend/LegendCategories/index.tsx

View workflow job for this annotation

GitHub Actions / lint (16.x)

Do not use Array index in keys
<div
className={classnames(`${CLS_PREFIX}__content__shape`, {
[`${CLS_PREFIX}__content__${geometryType}`]: geometryType,
Expand Down

0 comments on commit 0bb09a4

Please sign in to comment.