简体   繁体   English

尝试导入错误:“ImageList”未从“@material-ui/core”导出

[英]Attempted import error: 'ImageList' is not exported from '@material-ui/core'

你好,我正在开发一个 React 应用程序,我正在尝试从 @material-ui 导入 ImageList 我使用"import { ImageList } from '@material-ui/core'; but it gives me error while compiling , i 've installed npm install @material-ui/core` 这是我的依赖项 "@material-ui/core": "^4.11.4", "react": "^17.0.2", "react-dom": "^ 17.0.2"

The ImageList component is only available in material-ui v5 (currently in alpha). ImageList 组件仅在 material-ui v5(目前为 alpha)中可用。

npm install @material-ui/core install the last stable version (v4.11.1) npm install @material-ui/core安装最新稳定版(v4.11.1)

For the alpha version you should use the following command install @material-ui/core@next @emotion/react @emotion/styled as described in the official documentation at https://next.material-ui.com/对于 alpha 版本,您应该使用以下命令install @material-ui/core@next @emotion/react @emotion/styled ,如https://next.material-ui.com/ 上的官方文档中所述

确保您使用的是材质 ui 5。在材质 ui 4 中,您必须使用 GridList 而不是 ImageList

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 尝试导入错误:“useThemeVariants”未从“@material-ui/styles”导出 - Attempted import error: 'useThemeVariants' is not exported from '@material-ui/styles' 尝试导入错误:“ToogleButton”未从“@material-ui/lab”导出 - Attempted import error: 'ToogleButton' is not exported from '@material-ui/lab' 尝试导入错误:“unstable_useId”未从“@material-ui/core/utils”导出(导入为“useId”) - Attempted import error: 'unstable_useId' is not exported from '@material-ui/core/utils' (imported as 'useId') 尝试导入错误:“makeStyles”未从“@material-ui/core/styles”导出 - Attempted import error: 'makeStyles' is not exported from '@material-ui/core/styles' 尝试导入错误:“useControlled”未从“@material-ui/core/utils”导出 - Attempted import error: 'useControlled' is not exported from '@material-ui/core/utils' 尝试导入错误:“fade”未从“@material-ui/core/styles”导出 - Attempted import error: 'fade' is not exported from '@material-ui/core/styles' 尝试导入错误:“alpha”未从“@material-ui/core/styles”导出 - Attempted import error: 'alpha' is not exported from '@material-ui/core/styles' 错误尝试导入错误:“NotificationsNoneIcon”未从“@material-ui/icons”导出 - error Attempted import error: 'NotificationsNoneIcon' is not exported from '@material-ui/icons' 尝试导入错误:“GlobalStyles”未从“@material-ui/system”导出(导入为“SystemGlobalStyles”) - Attempted import error: 'GlobalStyles' is not exported from '@material-ui/system' (imported as 'SystemGlobalStyles') 在 Material UI 中使用骨架时,如何修复错误“alpha”未从“@material-ui/core/styles”导出 - How to fix the error 'alpha' is not exported from '@material-ui/core/styles' when using Skeleton in Material UI
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM