-
Notifications
You must be signed in to change notification settings - Fork 12.2k
Description
Bug description
While working on setting up a Font Awesome subset for a React-based project, I wanted to use findIconDefinition(). I currently have our own icon names set up like this:
const ICON_MAP = {
angleDown: faAngleDown
...
}
I want to phase out ICON_MAP so that we can use the regular Font Awesome names. For that, I chose to use a mapper that maps names such as angleDown to angle-down and passes this to findIconDefinition() in order to verify that the icon exists and that the types are correct.
The problem is that in the Font Awesome API docs, the use of findIconDefinition({ iconName: "<NAME>" }) is described. It works as expected, but when the icon is only available outside the fas prefix, it returns undefined. The expected behavior is that it also searches in other prefixes.
https://docs.fontawesome.com/apis/javascript/methods#basic-use
Reproducible test case
https://codepen.io/cvanh/pen/WbrpPRW
Screenshots
Font Awesome version
v7
Serving
Kit
Implementation
Other (as specified in the bug description)
Browser and Operating System
- Firefox 143 on macOS (Catalina)
Web bug report checklist
- I have included a test case because my odds go way up that the team can fix this when I do
- I have searched for existing issues and to the best of my knowledge this is not a duplicate