Topic: Problems with Fontawesome
Hi, I am facing a problem in mdb react pro and FontAwesome. I did all the steps from the getting started. (https://mdbootstrap.com/react/5-min-quick-start/)
import ‘font-awesome/css/font-awesome.min.css’;
import ‘bootstrap/dist/css/bootstrap.min.css’;
import ‘mdbreact/dist/css/mdb.css’;
There are no icons displayed. E.g. when I try this: as shown in example:https://mdbootstrap.com/react/content/table-styles/#table-with-icons
Instead there's only a square
Any help is welcome! 🙂
kind regards,Josef
Jakub Mandra staff premium answered 6 years ago
kanwar answered 5 years ago
Hi, I am facing a problem in mdb react pro and FontAwesome. I did all the steps from the getting started. (https://mdbootstrap.com/react/5-min-quick-start/)
import ‘font-awesome/css/font-awesome.min.css’; import ‘bootstrap/dist/css/bootstrap.min.css’; import ‘mdbreact/dist/css/mdb.css’;
There are no icons displayed. The same problem arises
Can you please help me
kind regards, Priyanka
Jakub Chmura staff premium answered 5 years ago
Hi @kanwar,
It is very important to import the required file before 'app.js' in your CRA project.
This is an example of default index.js in the CRA project. Please paste these imports to your project.
import React from 'react';
import ReactDOM from 'react-dom';
import '@fortawesome/fontawesome-free/css/all.min.css';
import 'bootstrap-css-only/css/bootstrap.min.css';
import './dist/css/mdb.css';
import './index.css';
import App from './App';
import registerServiceWorker from './registerServiceWorker';
ReactDOM.render(<App />, document.getElementById('root'));
registerServiceWorker();
Let me know if my solution works in your case.
Best, Kuba.
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Pro
- Premium support: No
- Technology: MDB React
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: Yes