diff --git a/scm-ui/ui-components/src/table/Table.tsx b/scm-ui/ui-components/src/table/Table.tsx index 4d12e1c681..b99feec03a 100644 --- a/scm-ui/ui-components/src/table/Table.tsx +++ b/scm-ui/ui-components/src/table/Table.tsx @@ -37,9 +37,9 @@ const Table: FC = ({ data, sortable, children, emptyMessage }) => { } }); - const mapDataToColumns = (row: any) => { + const mapDataToColumns = (row: any, rowIndex: number) => { return ( - + {React.Children.map(children, (child, columnIndex) => { return {React.cloneElement(child, { ...child.props, columnIndex, row })}; })} @@ -93,6 +93,7 @@ const Table: FC = ({ data, sortable, children, emptyMessage }) => { onClick={isSortable(child) ? () => tableSort(index) : undefined} onMouseEnter={() => setHoveredColumnIndex(index)} onMouseLeave={() => setHoveredColumnIndex(undefined)} + key={index} > {child.props.header} {isSortable(child) && renderSortIcon(child, ascending, shouldShowIcon(index))}