Reputation: 45
I am working with node.js and react.js. I already imported my own css file like so:
import React from 'react';
import Modal from 'react-modal';
import './../App.css';
this works fine, but when I try to add font-awesome like so:
import './src/font-awesome-4.7.0/css/font-awesome.css'
then it doesn't work.
Am I doing something wrong? Or is there maybe another way?
Upvotes: 3
Views: 6676
Reputation: 8542
Here's how i did it entirely in the front end react side:
Include font awesome inside the <head>
tag
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
Install react-fontawesome
npm install --save react-fontawesome
Import the file and use it in your react components
import FontAwesome from 'react-fontawesome';
// ..rest of your code
<FontAwesome name="linkedin" size="2x"/>
Upvotes: 8