Created
March 13, 2020 01:30
-
-
Save ksaldana1/3e2a05ae15f0a0854d4f1e5bf123d822 to your computer and use it in GitHub Desktop.
re_example_1.4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[@react.component] | |
let make = () => { | |
let query = Query.use(~variables=(), ()); | |
<div className=Styles.app> | |
{Belt.Array.map(query.messages, message => { | |
switch (message.author) { | |
| `User(user) => | |
<div> {React.string(user.name ++ ": " ++ message.text)} </div> | |
| `Guest(guest) => | |
<div> | |
{React.string(guest.placeholder ++ ": " ++ message.text)} | |
</div> | |
| `UnmappedUnionMember => React.null | |
} | |
}) | |
->React.array} | |
</div>; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment