-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Warn About Outdated Material-UI version
- Loading branch information
Showing
3 changed files
with
30 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* eslint-disable no-console */ | ||
import { ToggleButtons } from '@material-ui/core'; | ||
|
||
// ToogleButtons was introduced on Material-UI 1.4.0 | ||
// which is the minimum supported version of React Admin | ||
// https://github.com/mui-org/material-ui/releases/tag/v1.4.0 | ||
const muiVersionIsSupported = !!ToggleButtons; | ||
|
||
export const warnForUnsupportedMuiVersion = () => { | ||
if (process.env.NODE_ENV !== 'production' && !muiVersionIsSupported) { | ||
console.error( | ||
`Your version of @material-ui/core is not supported by ra-ui-materialui! | ||
Please install @material-ui/core@^1.4.0 in order to avoid uncertain UI behaviors on production. | ||
More infos at https://github.com/marmelab/react-admin/issues/1782` | ||
); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters