Skip to main content
Refine AI
Version: 4.xx.xx

Migration Guide for Material UI v6 and X Data Grid v7

Material UI has released major updates for the following packages:

  • @mui/material@6
  • @mui/icons-material@6
  • @mui/system@6
  • @mui/lab@6
  • @mui/material-nextjs@6
  • @mui/styled-engine-sc@6
  • @mui/utils@6
  • @mui/x-data-grid@7

This guide focuses on migrating Refine-related parts to the latest version.

Official Migration Guide:

Package Version Alignment

Note that @mui/x-* packages do not follow the same versioning strategy as other @mui/* packages. However, @refinedev/mui package versions has peer dependencies on @mui/x-* and other @mui/* packages. Please ensure following version alignment to avoid issues:

@refinedev/mui@mui/x-data-grid@mui/material@mui/system@mui/lab@mui/icons-material@refinedev/inferencer
5.x.x6.x.x5.x.x5.x.x5.x.x5.x.x4.x.x
6.x.x7.x.x6.x.x6.x.x6.x.x6.x.x5.x.x

Material UI Changes

For detailed information about Material UI changes, please refer to the official Material UI v6 migration guide.

Removed components

The following components has been deprecated since @refinedev/mui@6 and removed in @refinedev/mui@7:

Deprecated ComponentReplacementDocumentation
useSiderVisibleuseThemedLayoutContextView Docs
notificationProvideruseNotificationProviderView Docs
notificationProvideruseNotificationProviderView Docs
<Layout /><ThemedLayoutV2 />View Docs
<ThemedLayout /><ThemedLayoutV2 />View Docs
<Title /><ThemedTitleV2 />View Docs
<ThemedTitle /><ThemedTitleV2 />View Docs
<Sider /><ThemedSiderV2 />View Docs
<ThemedSider /><ThemedSiderV2 />View Docs
<Header /><ThemedHeaderV2 />View Docs
<ThemedHeader /><ThemedHeaderV2 />View Docs
<LoginPage /><ThemedLoginPage />View Docs
<WelcomePage />@refinedev/core
<ReadyPage />no replacement

Following deprecated types have been replaced with new types:

- RefineLayoutLayoutProps
- RefineThemedLayoutProps
+ RefineThemedLayoutV2Props

- RefineLayoutSiderProps
- RefineThemedLayoutSiderProps
+ RefineThemedLayoutV2SiderProps

- RefineLayoutHeaderProps
- RefineThemedLayoutHeaderProps
+ RefineThemedLayoutV2HeaderProps

X Data Grid Changes

The @refinedev/mui@6 package has no breaking changes except for updating to @mui/x-data-grid@7. However, @mui/x-data-grid@7 includes some important changes you need to check.

For detailed information about Data Grid changes, please refer to the official MUI X Migration Guide for Data Grid.

Stying

In @refinedev/mui@6, the useDataGrid hook was returning the following sx object for styling the Data Grid but in @mui/x-data-grid@7, the sx object has been removed to use default styles from @mui/x-data-grid@7.

import { darken, useTheme } from "@mui/material/styles";

const theme = useTheme();

const sx = {
border: "none",
"& .MuiDataGrid-columnHeaders": {
background: darken(theme.palette.background.paper, 0.05),
borderBottom: `1px solid ${darken(theme.palette.background.paper, 0.1)}`,
},
"& .MuiDataGrid-cell": {
borderBottom: `1px solid ${darken(theme.palette.background.paper, 0.05)}`,
},
};