Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix TypeScript type for maxColumnSort to match prop-types #672

Merged
merged 1 commit into from
Nov 20, 2022

Conversation

sjdemartini
Copy link
Contributor

Related Issue

n/a

Description

Without this, you get a TS error trying to set maxColumnSort to 0, which prevents you from turning off sorting. This adds 0 as an option, like it is with the PropTypes definition here

core/src/prop-types.js

Lines 387 to 400 in 8dc35d8

maxColumnSort: PropTypes.oneOf([
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
ALL_COLUMNS
]),

Impacted Areas in Application

TypeScript usage of the MaterialTable options.

Without this, you get a TS error trying to set `maxColumnSort` to 0,
which prevents you from turning off sorting. This adds 0 as an option,
like it is with the `PropTypes` definition here
https://github.com/material-table-core/core/blob/8dc35d85df2f87a77d067cae1fa5713fbb465f82/src/prop-types.js#L387
Copy link
Contributor

@Domino987 Domino987 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

@Domino987 Domino987 merged commit 7f17c37 into material-table-core:next Nov 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants