I am trying to use response-fontawesome and implement it in what seems to me exactly the same as readme: https://github.com/danawoodman/react-fontawesome/blob/master/readme.md
import React from 'react'; import FontAwesome from 'react-fontawesome' ... export default class ComponentName extends React.Component { render() { return ( <div> <div> <span> <FontAwesome className='super-crazy-colors' name='rocket' size='2x' spin style={{ textShadow: '0 1px 0 rgba(0, 0, 0, 0.1)' }} /> SOME TEXT </span> </div> ... </div> ) } }
But I do not see the icon in the DOM. Although I see in Chrome Dev Tools:
<span style="text-shadow:0 1px 0 rgba(0, 0, 0, 0.1);" aria-hidden="true" class="fa fa-rocket fa-2x fa-spin super-crazy-colors" data-reactid=".0.$/=11.0.0.$/=10.$/=10.$/=10"></span>
which, it seems to me, should be a <i> . I tried changing <span>...</span> to <i>...</i> in "edit as HTML" in dev tools and the icon still didn't display.
I have add-module-exports in my plugins and stage-2 in my settings in my webpack.config.
Can someone tell me if I missed something? Do I need some other package other than reaction-fontawesome to make this work? Do I need to import the standard font-awesome.css or download the font-awesome CDN? Any help would be greatly appreciated, thanks!
source share