简体   繁体   中英

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).

npm install @material-ui/core install the last stable version (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/

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM