Skip to content

Commit

Permalink
fix: use a key that triggers an update (#1128)
Browse files Browse the repository at this point in the history
  • Loading branch information
johanlahti committed Mar 12, 2023
1 parent 46b678d commit e94522f
Showing 1 changed file with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,19 @@ import ValueField from './ValueField';
function LabelsWithRanges({ labels, dense, showGray, checkboxes }) {
return (
<>
{labels.map(([label, highlighted]) => (
<ValueField
label={label}
key={label}
highlighted={highlighted}
dense={dense}
showGray={showGray}
checkboxes={checkboxes}
/>
))}
{labels.map(([label, highlighted], index) => {
const key = `${index}`;
return (
<ValueField
label={label}
key={key}
highlighted={highlighted}
dense={dense}
showGray={showGray}
checkboxes={checkboxes}
/>
);
})}
</>
);
}
Expand Down

0 comments on commit e94522f

Please sign in to comment.