It seems tedious (and like a footgun) to have to re-type all my imported icons into the library.add
function. Is there a way to get around this?
// font-awesome-library.js
import { library } from '@fortawesome/fontawesome-svg-core'
import {
faChartBar, faFileAlt, faBalanceScale, faUser, faFutbol, faBuilding,
faAddressBook, faChartLine, faDatabase, faServer, faLink, faCloudUpload,
faClipboard, faSlidersH, faChartBar, faUsers
} from '@fortawesome/pro-solid-svg-icons'
import { faFortAwesome} from '@fortawesome/free-brands-svg-icons';
// Re-listing these below seem tedious..
library.add(
faChartBar, faFileAlt, faBalanceScale, faUser, faFutbol, faBuilding,
faAddressBook, faChartLine, faDatabase, faServer, faLink, faCloudUpload,
faClipboard, faSlidersH, faChartBar, faUsers, faFortAwesome,
);
Also, if I typo the import (or use the wrong name, eg faBarChart
instead of faChartBar
) I get an unhelpful error in react-fontawesome: TypeError: Cannot read property 'prefix' of undefined
:(