Is there anyway i can use social media icons on my React Webpage?
import { library } from '@fortawesome/fontawesome-svg-core';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { fas, faHome, faMapMarker } from '@fortawesome/free-solid-svg-icons';
tried to import
import { fab } from '@fortawesome/free-brands-svg-icons';
library.add( fab, fas, faHome, faMapMarker)
Tried to use it as both examples
<FontAwesomeIcon icon="fab facebook-f" />
/<FontAwesomeIcon icon={['fab','facebook-f']} />
says fab cant be found on the fortawesome folder and throws an error
"Module not found: Can't resolve '@fortawesome/free-brands-svg-icons' in 'C:\Users\User\Desktop\tourism\src'"
As @fard said:
npm i --save @fortawesome/free-brands-svg-icons
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
import { faFacebook } from "@fortawesome/free-brands-svg-icons"
then past the following line
<FontAwesomeIcon icon={faFacebookF} />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With