1install the following packages into your project using a package manager like npm and yarn;
2//for npm installation copy the code below and paste it to your terminal:
3npm i --save @fortawesome/fontawesome-svg-core
4npm install --save @fortawesome/free-solid-svg-icons
5npm install --save @fortawesome/react-fontawesome
6//for yarn installation copy the code below and paste it to your terminal:
7yarn add @fortawesome/fontawesome-svg-core
8yarn add @fortawesome/free-solid-svg-icons
9yarn add @fortawesome/react-fontawesome
10
11/*After the installation,use the icons by first importing either of the packages
12installed and then importing the icon of your choice from the package.
13Refer to the below example*/
14import ReactDOM from 'react-dom'
15import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
16import { faCoffee } from '@fortawesome/free-solid-svg-icons'
17
18const element = <FontAwesomeIcon icon={faCoffee} />
19
20ReactDOM.render(element, document.body)