communityconnect icon indicating copy to clipboard operation
communityconnect copied to clipboard

Font Awesome Icon Local Library

Open davidholyko opened this issue 6 years ago • 1 comments

we can increase the performance in this area by importing only the icons we plan to use at the root level instead of importing the entire FA icon library

davidholyko avatar Aug 09 '19 22:08 davidholyko

current index.js

library.add(fab, fas);

this add all the icons from the font-awesome basic and font-awesome solid libraries which is a lot to import. we can individually import the icons and that will help with performance

link to use an example: https://scotch.io/tutorials/using-font-awesome-5-with-react#toc-creating-an-icon-library

// import the library
import { library } from '@fortawesome/fontawesome-svg-core';

// import your icons
import { faMoneyBill } from '@fortawesome/pro-solid-svg-icons';
import { faCode, faHighlighter } from '@fortawesome/free-regular-svg-icons';

library.add(
  faMoneyBill,
  faCode,
  faHighlighter
  // more icons go here
);

davidholyko avatar Sep 09 '19 15:09 davidholyko