How to include a Font Awesome icon in React's render()

前端 未结 15 1643
刺人心
刺人心 2020-12-04 06:30

Whenever I try to use a Font Awesome icon in React\'s render(), it isn\'t displayed on the resulting web page although it works in normal HTML.

         


        
15条回答
  •  伪装坚强ぢ
    2020-12-04 06:59

    React uses the className attribute, like the DOM.

    If you use the development build, and look at the console, there's a warning. You can see this on the jsfiddle.

    Warning: Unknown DOM property class. Did you mean className?

提交回复
热议问题