'React Font Awesome - Icon code \f00d does not show
I am trying to add an icon to an existing project who already used icons. I need this particular one with the code '\f00d'. I can see it in node_modules/font-awesome/css/font-awesome.css as following:
.fa-remove:before, .fa-close:before, .fa-times:before { content: "\f00d"; }
However it is not working with any of those clases ( other icons work, like .fa-window-close:before { content: "\f2d3"; } )
This is how I am using it:
<i className="fas fa-close" onClick={onClose} />
Solution 1:[1]
It appears you are using Font Awesome v.5.0 or lower, in this version fa-times regular is only available in FA5 Pro. I would urge you to upgrade your Font Awesome package to v.6 and following their guidlines for using Font Awesome in React projects. Font Awesome React Docs. There you could use, https://fontawesome.com/icons/xmark?s=solid. But regular is still only available to Pro users.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Dylan L. |
