mui-x
mui-x copied to clipboard
[DataGrid] Change isCellEditable params type
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:
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):
The fix
With my fairly simple MR, Typescript understands what's happening and warns the user against potential bug:
That's pretty much it.
Deploy preview: https://deploy-preview-12896--material-ui-x.netlify.app/
Generated by :no_entry_sign: dangerJS against 3ce1f66f0b16bb3a8e9db00e6929b9c025ee4f55
Your additional fix makes total sense and no apology needed, all the effort is on you guys' side. Thanks for the review!
This pull request has conflicts, please resolve those before we can evaluate the pull request.