So works if you check isDraft
equality against Js.true_
/ Js.false_
. I figured try that since that’s bucklescripts true/false on Js.boolean.
@ncthbrt, thanks for sticking with me.
This is what got it working:
//FeedPage.re
...
response##feed
|> Array.mapi((index, post) =>
<PostItem
key=(index |> string_of_int)
id=post##id
title=post##title
isDraft=post##isPublished
post
/>
)
|> ReasonReact.arrayToElement
...
Then in PostItem.re
//PostItem.re
...
let make = (~title, ~isDraft, ~post, ~id, _children) => {
...component,
render: _self => {
let title =
isDraft == Js.false_ ?
title |> Aliases.ste : title ++ "Draft" |> Aliases.ste;
...