Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React JS - React Material UI icons not working?

Tags:

reactjs

I am using react Material UI, and I received the following error.

"Module not found: Can't resolve '@material-ui/icons/Lock'"

import LockIcon from '@material-ui/icons/Lock';

How can I fix this?

like image 422
Ramya MiiM Avatar asked Sep 20 '18 08:09

Ramya MiiM


1 Answers

import Icon from '@material-ui/core/Icon';

then add font material icons to index.html

<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
like image 199
Mohammed Elzanaty Avatar answered Nov 15 '22 02:11

Mohammed Elzanaty