title: How can I get Font Awesome 5 to work with React?
body: <p>In the following example, the initial icon renders but it does not change when the class changes.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="true">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const Circle = ({ filled, onClick }) =&gt; {
    const className = filled ? 'fas fa-circle' : 'far fa-circle';
    
    return (
      &lt;div onClick={onClick} &gt;
        &lt;i className={className} /&gt;
        &lt;p&gt;(class is {className})&lt;/p&gt;
      &lt;/div&gt;
    );
  };
  
  class App extends React.Component {
    state = { filled: false };
  
    handleClick = () =&gt; {
      this.setState({ filled: !this.state.filled });
    };
    
    render() {
      return &lt;Circle filled={this.state.filled} onClick={this.handleClick} /&gt;;
    }
  }
  
  ReactDOM.render(&lt;App /&gt;, document.getElementById("root"));</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://use.fontawesome.com/releases/v5.0.2/js/all.js"&gt;&lt;/script&gt;
  &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react.min.js"&gt;&lt;/script&gt;
  &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react-dom.min.js"&gt;&lt;/script&gt;
  
  &lt;div id="root"&gt;&lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>