Estoy tratando de crear un componente de barra lateral e importar los diferentes íconos para crear la interfaz de usuario, pero no se muestran en la pantalla. Probé otras soluciones mencionadas aquí, no funcionó del todo.
<SidebarOption Icon = {InsertCommentIcon} title ="Threads"/> <SidebarOption Icon = {InboxIcon} title ="Mentions & Reactions"/> <SidebarOption Icon = {DraftsIcon} title ="Saved items"/> <SidebarOption Icon = {BookmarkBorderIcon} title ="Channel browser"/> <SidebarOption Icon = {PeopleAltIcon} title ="People & user groups"/> <SidebarOption Icon = {AppsIcon} title ="Apps"/> <SidebarOption Icon = {FileCopyIcon} title ="File browser"/> <SidebarOption Icon = {ExpandLessIcon} title ="Show less"/> <SidebarOption Icon = {ExpandMoreIcon} title ="Show more"/>hizo la importación como de costumbre
import InsertCommentIcon from "@material-ui/icons/InsertComment"; import DraftsIcon from "@material-ui/icons/Drafts"; import InboxIcon from "@material-ui/icons/Inbox";y así sucesivamente para todos los iconos.
Pero los íconos no están visibles en la barra lateral. ¿Cuál crees que podría ser el problema y qué debo solucionar?
tus importaciones están mal, prueba estas
import InsertCommentIcon from '@mui/icons-material/InsertComment'; import DraftsIcon from '@mui/icons-material/Drafts'; import InboxIcon from '@mui/icons-material/Inbox';y así ...
también solo para estar seguro, asegúrese de haber instalado MUI e iconos correctamente:
npm install @mui/materialy
npm install @mui/icons-material