Skip to content

Commit

Permalink
Don't use index as row key.
Browse files Browse the repository at this point in the history
  • Loading branch information
yesmeck committed Dec 8, 2016
1 parent 66f7b05 commit 8fcc4ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion components/table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ export default class Table<T> extends React.Component<TableProps<T>, any> {
if (typeof rowKey === 'function') {
return rowKey(record, index);
}
let recordKey = record[rowKey as string] !== undefined ? record[rowKey as string] : index;
const recordKey = record[rowKey as string];
warning(recordKey !== undefined,
'Each record in table should have a unique `key` prop, or set `rowKey` to an unique primary key.'
);
Expand Down

0 comments on commit 8fcc4ce

Please sign in to comment.