jzabala / gatsby-plugin-fontawesome-css

Gatsby plugin that disables Font Awesome auto CSS insertion and instead inserts it at compile time.
14 stars 7 forks source link

Feature Request: Compatible with dynamically generated icons. #7

Open AnderUstarroz opened 3 years ago

AnderUstarroz commented 3 years ago

Doesn't seems to work with dynamically generated icons (icons fetched from some API) For instance the following component would display icons dynamically:

import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'

const Icon = ({group, icon}) => {
  return <FontAwesomeIcon icon={[group, icon]} />
}

export default Icon

Is there a way to achieve this without having to import statically the icons in advance?

import {
  faCoffee,
  faAddressBook,
  faAirFreshener,
  faAmbulance,
  faAtom,
  faBus,
  faCoins,
  faDice,
} from '@fortawesome/free-solid-svg-icons'