简体   繁体   中英

Why do I have an error when I try a multiple import of icons in mui icons?

I saw on the forum that there is a way to do a multiple import of Material UI icons, so I tried to go from this:

import InterestsRoundedIcon from "@mui/icons-material/InterestsRounded";
import AccountCircleRoundedIcon from "@mui/icons-material/AccountCircleRounded";
import SettingsRoundedIcon from "@mui/icons-material/SettingsRounded";

to this

import { InterestsRoundedIcon, AccountCircleRoundedIcon, SettingsRoundedIcon } from "@mui/icons-material";

but when I try to launch my start my code I got this issue

Compiled with problems: ERROR in./src/components/sidebar/Sidebar.jsx 44:42-62 export 'InterestsRoundedIcon' (imported as 'InterestsRoundedIcon') was not found in >'@mui/icons-material'

and I got those problems if i try to import either from "@mui/icons-material" or "@material-ui/icons"

Try this:

import {
  InterestsRounded as InterestsRoundedIcon,
  AccountCircleRounded as AccountCircleRoundedIcon,
  SettingsRounded as SettingsRoundedIcon,
} from "@mui/icons-material";

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