Skip to content

Commit

Permalink
fix(tooltiptable): fix non-unique react keys (#365)
Browse files Browse the repository at this point in the history
* fix(tooltiptable): fix non-unique react keys

* refactor(tooltiptable): refactor code
  • Loading branch information
masoudmanson authored Feb 23, 2023
1 parent ac94655 commit f504156
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/core/TooltipTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,18 @@ const TooltipTableContent = (props: TooltipTableContentProps): JSX.Element => {
return (
<TableContainer {...rest}>
{contentAlert && <Alert>{contentAlert}</Alert>}
{data?.map((section) => (
<Section disabled={section.disabled} key={`${section.label}`}>
{data?.map((section, index) => (
<Section
disabled={section.disabled}
key={`${section.label + String(index)}`}
>
<SectionLabel disabled={section.disabled} label={section.label}>
{section.label}
</SectionLabel>
<Table size="small">
<TableBody>
{section.dataRows.map((row) => (
<TableRow key={row.label}>
{section.dataRows.map((row, rowIndex) => (
<TableRow key={row.label + String(rowIndex)}>
<RowLabel disabled={section.disabled} align="left">
{row.label}
</RowLabel>
Expand Down

0 comments on commit f504156

Please sign in to comment.