react-fontawesome
react-fontawesome copied to clipboard
FontAwesomeIcon throwing "Could not find icon" when using with Pro regular sharp icons
Describe the bug
When trying to use FontAwesomeIcon
react component with paid sharp regular icons, an error is being thrown in the console saying Could not find icon
Reproducible test case
-
import { faCircleExclamation } from '@fortawesome/sharp-regular-svg-icons'
- Add it to the libary
import { library } from '@fortawesome/fontawesome-svg-core'
library.add(faCircleExclamation)
- Attempt to use the icon:
<FontAwesomeIcon icon="circle-exclamation" />
- Error in the browsers console:
It seems that the FontAwesomeIcon
component is trying to run a lookup using wrong prefix fas
. The prefix of this icon is fasr
Furthermore, it seems that the IconPrefix
type does not include fasr
:
export type IconPrefix = "fas" | "far" | "fal" | "fat" | "fad" | "fab" | "fak" | "fass" ;
, which means that following syntax throws static TS error:
<FontAwesomeIcon icon={{ prefix: `fasr`, iconName: `circle-exclamation` }} />
Expected behavior Should be able to render the icon.
Package versions
"@fortawesome/fontawesome-common-types": "^6.3.0",
"@fortawesome/fontawesome-svg-core": "^6.3.0",
"@fortawesome/free-regular-svg-icons": "^6.3.0",
"@fortawesome/free-solid-svg-icons": "^6.3.0",
"@fortawesome/react-fontawesome": "^0.2.0",
"@fortawesome/sharp-regular-svg-icons": "^6.3.0",
Thanks in advance! Let me know if you need more information!
This bug also applies to the library @fortawesome/pro-regular-svg-icons
.
So basically pro icons can not be used with FontAwesomeIcon
Any movement in regards to fixing the issue?
@sampolahtinen Is this specific to version 6? We are successfully using pro icons from Font Awesome V5 via react-fontawesome
...but now you have me nervous about our planned migration to v6.