Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

311
Visualizações
how to import material ui icons?i met some problems using Material ui icons

I was using material UI with react in my project,and i have some troubles when it come to import the material icons,my code is copied from the material UI (version:"material-ui": "^1.0.0-beta.41", "material-ui-icons": "^1.0.0-beta.36",) docs ,just like this:

import SkipPreviousIcon from '@material-ui/icons/SkipPrevious';
import PlayArrowIcon from '@material-ui/icons/PlayArrow';
import SkipNextIcon from '@material-ui/icons/SkipNext';

and also i have run npm install material-icons. the error in my chrome console is:

./src/index/musicCard.js Module not found: Can't resolve '@material-ui/icons/PlayArrow' in 'C:\Users\wenji\Desktop\myblog\src\index' and I tried this one:

import SkipPreviousIcon from 'material-ui/icons/SkipPrevious';

and this one:

import SkipPreviousIcon from '@material-ui-icons/SkipPrevious';

but dose not make any difference,so can anyone help me ?

over 4 years ago · Santiago Trujillo
3 Respostas
Responde à pergunta

0

Icons are not part of material-ui/core so it must be install using two commands.

If you are using npm

npm install @material-ui/core
npm install @material-ui/icons

If you are using yarn

yarn add @material-ui/core
yarn add @material-ui/icons
over 4 years ago · Santiago Trujillo Relatório

0

Solved, the icons module should be added to dependencies. use npm

npm install @material-ui/icons 

or use yarn

yarn add @material-ui/icons 
over 4 years ago · Santiago Trujillo Relatório

0

I just solved a strange, ( but not so strange after i found out why) issue

on mac it worked but when i deploy to linux it failed and could not find the icon

this was because on mac it is not case sensitive and linux is

so

import DeleteForEver from '@material-ui/icons/DeleteForEver'

works on mac but fails on linux

the file is actually named like "DeleteForever"

so correct way to import is

import DeleteForever from '@material-ui/icons/DeleteForever'
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda