Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
reason-react bindings for Font Awesome 5
[@bs.module "@fortawesome/react-fontawesome"] external reactClass : ReasonReact.reactClass = "FontAwesomeIcon";
external makeProps:
~icon: array(string),
~id: string=?,
~className: string=?,
~style: ReactDOMRe.Style.t=?,
) =>
_ =
let make = (~icon, ~id=?, ~className=?, ~style=?, children) =>

This comment has been minimized.

Copy link
Owner Author

@Enalmada Enalmada commented Oct 4, 2018

Disclaimer: I am very new at bindings and just did something up quick to keep me going. Eventually this could be published as bs-font-awesome or something but it is so small right now it is best to copy it in to your reasonml bindings directory.

I am currently using it in a Next.js project with app wrapper initializing font awesome with regular javascript (ex: )and then using the icons in reason files:

<FontAwesomeIcon icon=["fal", "comments"] className="fa-5x" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment