To avoid dealing with duplicate names from different icon styles (solid, regular, etc.), just use apply
!
Last active
November 23, 2019 01:47
-
-
Save stevensacks/0a88e2aaedbb423021189f9e9ac51d91 to your computer and use it in GitHub Desktop.
FontAwesomeIcon without using 'as'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
faCircle, | |
faCoffee, | |
faExclamationTriangle, | |
} from '@fortawesome/free-regular-svg-icons'; | |
export default [ | |
faCircle, | |
faCoffee, | |
faExclamationTriangle, | |
]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
faCircle, | |
faCoffee, | |
faExclamationTriangle, | |
} from '@fortawesome/free-solid-svg-icons'; | |
export default [ | |
faCircle, | |
faCoffee, | |
faExclamationTriangle, | |
]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import far from './far'; | |
import fas from './fas'; | |
import {library} from '@fortawesome/fontawesome-svg-core'; | |
library.add.apply(library, fas.concat(far)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment