Skip to content

Instantly share code, notes, and snippets.

@Faliszek
Created October 23, 2018 07:13
Show Gist options
  • Save Faliszek/59ca43872be39d33afc463003801bea9 to your computer and use it in GitHub Desktop.
Save Faliszek/59ca43872be39d33afc463003801bea9 to your computer and use it in GitHub Desktop.
let component = ReasonReact.statelessComponent("Icon");
type iconType =
| Spotify;
let typeOfIcon = (t: iconType) =>
switch (t) {
| Spotify => "fab fa-spotify"
};
let make = (~iconType: iconType, _children) => {
...component,
render: _self => <div> <i className={typeOfIcon(iconType)} /> </div>,
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment