From e640448474000a999590abbc8caa0ac60f8a3c87 Mon Sep 17 00:00:00 2001 From: NathanPB Date: Tue, 18 Feb 2020 00:00:53 -0300 Subject: [PATCH] Added warnings when omitted columnKeys are found in a column reorderable DataTable --- src/components/datatable/DataTable.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/datatable/DataTable.js b/src/components/datatable/DataTable.js index 3b85d15c42..79c7191fa8 100644 --- a/src/components/datatable/DataTable.js +++ b/src/components/datatable/DataTable.js @@ -230,6 +230,10 @@ export class DataTable extends Component { this.onColumnDrop = this.onColumnDrop.bind(this); this.onVirtualScroll = this.onVirtualScroll.bind(this); this.frozenSelectionMode = null; + + if (this.props.reorderableColumns && !this.props.children.every(it => it.columnKey)) { + console.warn('Omitting columnKey property of Column child in a column reorderable DataTable may imply in duplication of the Columns if they have the same field.') + } } getFirst() {