To use react-fontawesome with React, we run
npm i react-fontawesome
to install the icon packages.
Then we use it by writing
const React = require("react");
const FontAwesome = require("react-fontawesome");
const MyComponent = () => {
return (
<FontAwesome
className="super-crazy-colors"
name="rocket"
size="2x"
spin
style={{ textShadow: "0 1px 0 rgba(0, 0, 0, 0.1)" }}
/>
);
};
to add the FontAwesome
component into the MyComponent
React component.