update warning message

This commit is contained in:
afc163 2018-07-20 12:10:43 +08:00
parent f22353cd2b
commit e2b9e5d832

View File

@ -626,7 +626,8 @@ export default class Table<T> extends React.Component<TableProps<T>, TableState<
const recordKey = (typeof rowKey === 'function') ?
rowKey(record, index) : (record as any)[rowKey as string];
warning(recordKey !== undefined,
'Each record in dataSource of table should have a unique `key` prop, or set `rowKey` to an unique primary key,' +
'Each record in dataSource of table should have a unique `key` prop, ' +
'or set `rowKey` of Table to an unique primary key, ' +
'see https://u.ant.design/table-row-key',
);
return recordKey === undefined ? index : recordKey;