簡體   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"

ImageList 組件僅在 material-ui v5(目前為 alpha)中可用。

npm install @material-ui/core安裝最新穩定版(v4.11.1)

對於 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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM