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

[DataGrid] Change isCellEditable params type #12896

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

atomheartother
Copy link

Hi MUI-X team, thanks for your hard work.

I believe I have come across an incorrect type for isCellEditable's params, see the diff.

The bug

As the types currently are on master (and in production) , params.row is any, meaning any typo or wrong property on params.row won't be picked up by TS, despite users' efforts to type their grid strongly:

image

This also means params.value is, I believe, incorrectly typed, making it look like the value has the row's type (which it shouldn't):

image

The fix

With my fairly simple MR, Typescript understands what's happening and warns the user against potential bug:

image

That's pretty much it.

@mui-bot
Copy link

mui-bot commented Apr 24, 2024

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

Generated by 🚫 dangerJS against 05493a8

@atomheartother atomheartother changed the title Change isCellEditable params type [DataGrid] Change isCellEditable params type Apr 24, 2024
@zannager zannager added the component: data grid This is the name of the generic UI component, not the React module! label Apr 25, 2024
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.

None yet

3 participants