how to import material ui icons?i met some problems using Material ui icons how to import material ui icons?i met some problems using Material ui icons javascript javascript

how to import material ui icons?i met some problems using Material ui icons


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/corenpm install @material-ui/icons

If you are using yarn

yarn add @material-ui/coreyarn add @material-ui/icons


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

npm install @material-ui/icons 

or use yarn

yarn add @material-ui/icons 


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'