I am playing around with '@fortawesome/react-fontawesome'(using FontAwesome5) and this is what I am trying to do-
In my App.js
import fontawesome from '@fortawesome/fontawesome'
import FontAwesomeIcon from '@fortawesome/react-fontawesome'
import { faTrash, faCoffee, faSquare } from '@fortawesome/fontawesome-pro-light'
fontawesome.library.add(faTrash, faCoffee, faSquare)
and in my component.js
import {FontAwesomeIcon} from 'eui-components'
function Test () {
return (
<tr>
<td><Button bsStyle="primary">
Delete
<FontAwesomeIcon icon = {["fal", "coffee"]}/>
</Button>
</td>
</tr>
)
}
export default Test
It works
And then I tried
<FontAwesomeIcon icon={["fal", "bath"]} />
and that worked in spite of it not being added in library. This is very confusing. How can I make sure that only the items added to library will work? That was my understanding. Am I wrong?
Code can be seen in codesandbox.io/s/40v5jk6no7