MUI X: Build complex and data-rich applications using a growing list of advanced React components, like the Data Grid, Date and Time Pickers, Charts, and more!
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:
Hi MUI-X team, thanks for your hard work.
I believe I have come across an incorrect type for
isCellEditable
'sparams
, see the diff.The bug
As the types currently are on master (and in production) ,
params.row
isany
, meaning any typo or wrong property onparams.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.