From 6fb01f59b0c6e1702473d443a5d33fdc9da7b8d1 Mon Sep 17 00:00:00 2001 From: KippWade <43067502+KippWade@users.noreply.github.com> Date: Thu, 1 Feb 2024 11:35:21 -0500 Subject: [PATCH] Update material-table.js (#823) Create check if consumer uses depreciated prop, instead of issuing waring automatically. --- src/material-table.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/material-table.js b/src/material-table.js index 7d14c3e8..0f3a3bb5 100644 --- a/src/material-table.js +++ b/src/material-table.js @@ -465,9 +465,15 @@ export default class MaterialTable extends React.Component { (a) => a.tableData.id === orderBy ); query.orderDirection = orderDirection; - console.warn( - 'Properties orderBy and orderDirection had been deprecated when remote data, please start using orderByCollection instead' - ); + /** + * THIS WILL NEED TO BE REMOVED EVENTUALLY. + * Warn consumer of deprecated prop. + */ + if (query.orderDirection !== undefined || query.orderBy !== undefined) { + console.warn( + 'Properties orderBy and orderDirection had been deprecated when remote data, please start using orderByCollection instead' + ); + } query.orderByCollection = orderByCollection; this.onQueryChange(query, () => { this.props.onOrderChange &&