Skip to content

Instantly share code, notes, and snippets.

@dangdennis
Last active July 4, 2019 05:35
Show Gist options
  • Save dangdennis/19b27ae17dcffa826addb8fd249766f0 to your computer and use it in GitHub Desktop.
Save dangdennis/19b27ae17dcffa826addb8fd249766f0 to your computer and use it in GitHub Desktop.
/* ReasonElements.re */
let component = ReasonReact.statelessComponent("ReasonElements");
let make = _children => {
...component,
render: _self => {
let someListOfReactElements = [<div />, <div />, <div />];
let someArrayOfReactElements = Array.of_list(someListOfReactElements);
let isNull = true;
<div>
<div> {ReasonReact.string("Your third ReasonReact component")} </div>
<div> {ReasonReact.array(someArrayOfReactElements)} </div>
<div>
{
isNull ?
ReasonReact.null : <p> {ReasonReact.string("Not null!")} </p>
}
</div>
</div>;
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment