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

[data grid] Use readonly array for GridSortModel. #16627

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

pcorpet
Copy link
Contributor

@pcorpet pcorpet commented Feb 16, 2025

Changelog

Fix the type of the GridSortModel to allow readonly arrays.

@zannager zannager added the component: data grid This is the name of the generic UI component, not the React module! label Feb 17, 2025
@romgrk romgrk enabled auto-merge (squash) February 18, 2025 06:52
@mui-bot
Copy link

mui-bot commented Feb 18, 2025

Deploy preview: https://deploy-preview-16627--material-ui-x.netlify.app/

Generated by 🚫 dangerJS against aa5b1a3

@romgrk romgrk disabled auto-merge February 18, 2025 18:51
@romgrk
Copy link
Contributor

romgrk commented Feb 18, 2025

Some typings need adjusting.

@pcorpet
Copy link
Contributor Author

pcorpet commented Feb 18, 2025

Some typings need adjusting.

Indeed, and that might somehow break compatibility: if you have any client code that use GridSortItem[] instead of the GridSortModel, then previous code like this

const [sortingModel, setSortingModel] = useState<GridSortItem[]>([])
...

would need to be updated, either by setting a readonly array there as well, or by changing to GridSortModel.

Is that ok?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: data grid This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants