-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
4.12.2: GridListTile and GridListTitleBar deprecation warnings incorrect #27497
Labels
component: image list
This is the name of the generic UI component, not the React module!
v5.x migration
Comments
robcaldecott
added
the
status: waiting for maintainer
These issues haven't been looked at yet by a maintainer
label
Jul 28, 2021
Thanks the for the report. Correct, we need to fix the warnings. The following diff should do it: index 10a3cb6fef..15775d5662 100644
--- a/packages/material-ui/src/GridListTile/GridListTile.d.ts
+++ b/packages/material-ui/src/GridListTile/GridListTile.d.ts
@@ -12,8 +12,8 @@ export interface GridListTileTypeMap<P = {}, D extends React.ElementType = 'li'>
/**
* <E2><9A><A0><EF><B8><8F> The GridList component was renamed to ImageList to align with the current Material Design naming.
*
- * You should use `import { ImageListTile } from '@material-ui/core'`
- * or `import ImageListTile from '@material-ui/core/ImageListTile'`.
+ * You should use `import { ImageListItem } from '@material-ui/core'`
+ * or `import ImageListItem from '@material-ui/core/ImageListItem'`.
* API:
*
* - [GridListTile API](https://material-ui.com/api/grid-list-tile/)
diff --git a/packages/material-ui/src/GridListTile/GridListTile.js b/packages/material-ui/src/GridListTile/GridListTile.js
index 5e6bf88df3..189bacfb82 100644
--- a/packages/material-ui/src/GridListTile/GridListTile.js
+++ b/packages/material-ui/src/GridListTile/GridListTile.js
@@ -70,8 +70,8 @@ let warnedOnce = false;
/**
* <E2><9A><A0><EF><B8><8F> The GridList component was renamed to ImageList to align with the current Material Design naming.
*
- * You should use `import { ImageListTile } from '@material-ui/core'`
- * or `import ImageListTile from '@material-ui/core/ImageListTile'`.
+ * You should use `import { ImageListItem } from '@material-ui/core'`
+ * or `import ImageListItem from '@material-ui/core/ImageListItem'`.
*/
const GridListTile = React.forwardRef(function GridListTile(props, ref) {
if (process.env.NODE_ENV !== 'production') {
@@ -79,10 +79,10 @@ const GridListTile = React.forwardRef(function GridListTile(props, ref) {
warnedOnce = true;
console.error(
[
- 'Material-UI: The GridListTile component was renamed to ImageListTile to align with the current Material Design naming.',
+ 'Material-UI: The GridListTile component was renamed to ImageListItem to align with the current Material Design naming.',
'',
- "You should use `import { ImageListTile } from '@material-ui/core'`",
- "or `import ImageListTile from '@material-ui/core/ImageListTile'`.",
+ "You should use `import { ImageListItem } from '@material-ui/core'`",
+ "or `import ImageListItem from '@material-ui/core/ImageListItem'`.",
].join('\n'),
);
}
diff --git a/packages/material-ui/src/GridListTileBar/GridListTileBar.d.ts b/packages/material-ui/src/GridListTileBar/GridListTileBar.d.ts
index 3d46b07e7f..bbb528c5f7 100644
--- a/packages/material-ui/src/GridListTileBar/GridListTileBar.d.ts
+++ b/packages/material-ui/src/GridListTileBar/GridListTileBar.d.ts
@@ -39,10 +39,10 @@ export type GridListTileBarClassKey =
| 'actionIconActionPosLeft';
/**
- * <E2><9A><A0><EF><B8><8F> The GridListTileBar component was renamed to ImageListTileBar to align with the current Material Design naming.
+ * <E2><9A><A0><EF><B8><8F> The GridListTileBar component was renamed to ImageListItemBar to align with the current Material Design naming.
*
- * You should use `import { ImageListTileBar } from '@material-ui/core'`
- * or `import ImageListTileBar from '@material-ui/core/ImageListTileBar'`.
+ * You should use `import { ImageListItemBar } from '@material-ui/core'`
+ * or `import ImageListItemBar from '@material-ui/core/ImageListItemBar'`.
* API:
*
* - [GridListTileBar API](https://material-ui.com/api/grid-list-tile-bar/)
diff --git a/packages/material-ui/src/GridListTileBar/GridListTileBar.js b/packages/material-ui/src/GridListTileBar/GridListTileBar.js
index a4df9aff8e..7417d6e45a 100644
--- a/packages/material-ui/src/GridListTileBar/GridListTileBar.js
+++ b/packages/material-ui/src/GridListTileBar/GridListTileBar.js
@@ -70,10 +70,10 @@ export const styles = (theme) => ({
let warnedOnce = false;
/**
- * <E2><9A><A0><EF><B8><8F> The GridListTileBar component was renamed to ImageListTileBar to align with the current Material Design naming.
+ * <E2><9A><A0><EF><B8><8F> The GridListTileBar component was renamed to ImageListItemBar to align with the current Material Design naming.
*
- * You should use `import { ImageListTileBar } from '@material-ui/core'`
- * or `import ImageListTileBar from '@material-ui/core/ImageListTileBar'`.
+ * You should use `import { ImageListItemBar } from '@material-ui/core'`
+ * or `import ImageListItemBar from '@material-ui/core/ImageListItemBar'`.
*/
const GridListTileBar = React.forwardRef(function GridListTileBar(props, ref) {
if (process.env.NODE_ENV !== 'production') {
@@ -81,10 +81,10 @@ const GridListTileBar = React.forwardRef(function GridListTileBar(props, ref) {
warnedOnce = true;
console.error(
[
- 'Material-UI: The GridListTileBar component was renamed to ImageListTileBar to align with the current Material Design naming.',
+ 'Material-UI: The GridListTileBar component was renamed to ImageListItemBar to align with the current Material Design naming.',
'',
- "You should use `import { ImageListTileBar } from '@material-ui/core'`",
- "or `import ImageListTileBar from '@material-ui/core/ImageListTileBar'`.",
+ "You should use `import { ImageListItemBar } from '@material-ui/core'`",
+ "or `import ImageListItemBar from '@material-ui/core/ImageListItemBar'`.",
].join('\n'),
);
} |
mnajdova
added
component: image list
This is the name of the generic UI component, not the React module!
and removed
status: waiting for maintainer
These issues haven't been looked at yet by a maintainer
labels
Jul 28, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
component: image list
This is the name of the generic UI component, not the React module!
v5.x migration
Current Behavior 😯
When rendering a
GridListTile
a console warning suggests to import and useImageListTile
instead but this is incorrect: you actually need to importImageListItem
.The same issue exists for
GridListTileBar
: you are warned to useImageListTileBar
when actually you need to useImageListItemBar
.Expected Behavior 🤔
The deprecation warnings need to be updated else you end up importing
undefined
components. :)Steps to Reproduce 🕹
The following codesandbox exhibits the warnings:
https://codesandbox.io/s/nervous-hooks-oigoe?file=/src/App.js
Your Environment 🌎
`npx @material-ui/envinfo`
The text was updated successfully, but these errors were encountered: