fix duplicate name/key render warning

This commit is contained in:
dannyrb 2020-05-12 15:10:26 -04:00 committed by James A. Petts
parent e29a777a9f
commit 1107779a63
2 changed files with 2 additions and 1 deletions

View File

@ -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 },

View File

@ -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;