简体   繁体   中英

Module not found: Can't resolve 'material-ui/FontIcon'

I have checked on my node module, FontIcon folder not present, its missing, I have tried many thinks but problem not resolved, Please help me. My package.json file:

{
  "name": "flipshop",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "axios": "^0.18.0",
    "material-ui": "^1.0.0-beta.40",
    "react": "^16.2.0",
    "react-bootstrap": "^0.32.1",
    "react-dom": "^16.2.0",
    "react-router-dom": "^4.2.2",
    "react-scripts": "1.1.1"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject"
  },
  "devDependencies": {
    "file-loader": "^1.1.11"
  }
}

FontIcon is not an export in material-ui version 1.0.0-beta.40 , you need to make use of Icons

To use FontIcons , include

<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"> 

in your project and then

To use an icon simply wrap the icon name (font ligature) with the Icon component, for example:

import Icon from 'material-ui/Icon';

 ...
<Icon>star</Icon>

Check the documentation

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