Skip to content

Commit

Permalink
Update material-table.js (#823)
Browse files Browse the repository at this point in the history
Create check if consumer uses depreciated prop, instead of issuing waring automatically.
  • Loading branch information
KippWade authored Feb 1, 2024
1 parent a80838c commit 6fb01f5
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/material-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down

0 comments on commit 6fb01f5

Please sign in to comment.