fix duplicate name/key render warning

This commit is contained in:
dannyrb authored and James A. Petts committed 2020-05-15 14:02:01 +02:00
1 parent e29a777a9f
commit 1107779a63
2 files changed
+2 -1

No files matched your search

@@ -39,7 +39,7 @@ const StudyListTableRow = props => {
return ( return (
<td <td
key={name} key={index}
className={classnames( className={classnames(
'px-4 py-2 text-base truncate', 'px-4 py-2 text-base truncate',
{ 'border-b border-secondary-light': !isExpanded }, { 'border-b border-secondary-light': !isExpanded },
@@ -164,6 +164,7 @@ function StudyListContainer({ history, data: studies }) {
}; };
const tableDataSource = studies const tableDataSource = studies
// TOOD: Move sort to DataSourceWrapper? // TOOD: Move sort to DataSourceWrapper?
// TODO: MOTIVATION, this is triggered on every render, even if list/sort does not change
.sort((s1, s2) => { .sort((s1, s2) => {
const noSortApplied = sortBy === '' || !sortBy; const noSortApplied = sortBy === '' || !sortBy;
const sortModifier = sortDirection === 'descending' ? 1 : -1; const sortModifier = sortDirection === 'descending' ? 1 : -1;