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] Remove cellClassRules
from GridColDef
#1716
Conversation
} | ||
|
||
const editCellState = editRowState && editRowState[column.field]; | ||
let cellComponent: React.ReactElement | null = null; | ||
|
||
if (editCellState == null && column.renderCell) { | ||
cellComponent = column.renderCell(cellParams); | ||
cssClassProp = { cssClass: `${cssClassProp.cssClass} MuiDataGrid-cellWithRenderer` }; | ||
classNames.push('MuiDataGrid-cellWithRenderer'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move those hardcoded class names into cssClassesConstants.ts
and build them using the GRID_CSS_CLASS_PREFIX
? That way if we change it in the future it will be easier to handle the change.
x-(the other places)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even better, we can reproduce the classes approach of the core component (dataGridClasses.ts + generateUtilityClasses
). I have added the item to #408.
Breaking changes
[DataGrid] Remove cellClassRules from GridColDef ([DataGrid] Remove
cellClassRules
fromGridColDef
#1716) @m4theushwThe
GridCellClassParams
type is not exported anymore. Replace it withGridCellParams
.The
cellClassRules
inGridColDef
was removed because it's redundant. The same functionality can be obtained usingcellClassName
and theclsx
utility:Closes #275
To be merged after #1687