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

font-awesome, reactjs

Solution

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?

Problem

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. ``` render: function() { return <div><i class="fa fa-spinner fa-spin">no spinner but why</i></div>; } ``` Here is an live example: http://jsfiddle.net/pLWS3/ Where is the fault?

Original source