Skip to content

Console warning for deprecated sorting option is unavoidable, showing up even if you do not set it or set it to false #671

Closed
@sjdemartini

Description

@sjdemartini

Describe the bug
In material-table-core v0.2.53, there is a console warning when the sorting option is defined in the options: Property sortinghas been deprecated, please start usingmaxColumnSort instead. https://github.com/material-table-core/core/pull/619 (added here here https://github.com/material-table-core/core/pull/619/files#diff-9a3982db9efabfd577b96de4d6949e3f608ac75defb3e1c99fd5294e465cbfa5R87-R91).

However, there is no way to avoid this warning currently. If you set it to false, the warning still appears. If you use the new maxColumnSort prop instead, the warning still shows up. Perhaps the sorting option in defaults/props.options.js should be removed, since maxColumnSort is set there instead anyway, and that will resolve the problem?

sorting: true,
maxColumnSort: 1,

For what it's worth, changing sorting to false also has no effect now, since it still allows you to sort, so perhaps references to it and this console warning should just be deleted now.

To Reproduce

Simply render the MaterialTable and you will see this console warning.

Loading the official example for multi-sort shows the console warning in dev tools upon page load, even though the sorting option is not used and the new multi-sort options are: https://material-table-core.com/demos/sort/multi/

Same with any other example demo from the site (for instance https://material-table-core.com/demos/style/header-cell/).

Expected behavior
No console warning about the sorting option if you don't set it.

Additional context

Using material-table-core v0.2.53

Seems potentially related to this #623

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions