Bool vs Js.boolean in ReasonReact

reasonreact

#21

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;
...

#22

Glad you got it working :smiley:
I still suspect there is some dependency which is pinning the compiler version to a previous version of bucklescript, I’d imagine though that this will be fixed in time.


#23

agreed. need to figure that out.