I want to use the pro RC3 in React. This library seems like the right choice, but it looks like it's designed only for the free version. How can I add my pro icon packs and have them recognized by this library? Is that supported yet?
I was able to copy /packages from the main repo into my project, and then import /packages/fontawesome-pro-
Most helpful comment
@robmadole Docs are overcomplicated.
Steps:
1) Go to https://fontawesome.com/how-to-use/on-the-web/setup/using-package-managers and copy this part:
to a file in the root of your project called
.npmrc2)
yarn add @fortawesome/fontawesome-pro @fortawesome/fontawesome-svg-core @fortawesome/pro-solid-svg-icons @fortawesome/react-fontawesome@fortawesome/fontawesome-pro- dunno what this does. I guess it checks.npmrcto confirm the token. Seems superfluous.@fortawesome/fontawesome-svg-core- dunno what this does. I guess it converts things likefont-size: 10pxorcolor: red;to adjust the size/color of your icon? It also makeslibraryavailable so you can add icons to your icon library.@fortawesome/pro-solid-svg-icons- Pro icon set. Replacesolidwithregularand/orlightto load different icon sets.@fortawesome/react-fontawesome- The<FontAwesomeIcon />component.3) Where your app is initialized (
app.jsfor CRA users;_app.jsfor Next.js users) select the icons that will go into your icon library:4) Now anywhere in your project you can use the
<FontAwesomeIcon />component like so:The
libraryapproach doesn't load icons multiple times so it's faster so use it. If a font isn't loading for some reason, check your terminal and you might see something likeprefix: 'fas' blah blahwhich means FontAwesome is looking for the default iconset prefix (fas). To fix this you need to pass in your font like so:<FontAwesomeIcon icon={['fab', 'instagram']} />.Ideally, FontAwesome would put all free icons in a single package, and all pro icons (including all the free ones) in a single package, and then just let users take advantage of tree-shaking to keep bundle sizes down.
Syntax _could_ look like this and take less than a paragraph for people to instantly understand it.