8.0.0-alpha.10
Jan 30, 2025
We'd like to offer a big thanks to the 10 contributors who made this release possible. Here are some highlights ✨:
- 🎨 Data Grid theming improvements and default background color
- 📚 Documentation improvements
- 🐞 Bugfixes
Special thanks go out to the community contributors who have helped make this release possible:
@k-rajat19, @lauri865, @mateuseap.
Following are all team members who have contributed to this release:
@alexfauquette, @flaviendelangle, @JCQuintas, @KenanYusuf, @MBilalShafi, @romgrk, @arminmeh.
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
Data Grid
Breaking changes
-
viewportInnerSize.width
now includes pinned columns' widths (fixes recursive loops in updating dimensions <-> columns)
-
The Data Grid now has a default background color, and its customization has moved from theme.mixins.MuiDataGrid
to theme.palette.DataGrid
with the following properties:
bg
: Sets the background color of the entire grid (new property)headerBg
: Sets the background color of the header (previously named containerBackground
)pinnedBg
: Sets the background color of pinned rows and columns (previously named pinnedBackground
)
const theme = createTheme({
- mixins: {
- MuiDataGrid: {
- containerBackground: '#f8fafc',
- pinnedBackground: '#f1f5f9',
- },
- },
+ palette: {
+ DataGrid: {
+ bg: '#f8fafc',
+ headerBg: '#e2e8f0',
+ pinnedBg: '#f1f5f9',
+ },
+ },
});
-
The detailPanels
, pinnedColumns
, and pinnedRowsRenderZone
classes have been removed.
-
Return type of the useGridApiRef()
hook and the type of apiRef
prop are updated to explicitly include the possibilty of null
. In addition to this, useGridApiRef()
returns a reference that is initialized with null
instead of {}
.
Only the initial value and the type are updated. Logic that initializes the API and its availability remained the same, which means that if you could access API in a particular line of your code before, you are able to access it as well after this change.
Depending on the context in which the API is being used, you can decide what is the best way to deal with null
value. Some options are:
- Use optional chaining
- Use non-null assertion operator if you are sure your code is always executed when the
apiRef
is not null
- Return early if
apiRef
is null
- Throw an error if
apiRef
is null