Today I Learned

hashrocket A Hashrocket project

Output Emojis 🔥 with ReasonReact

I’m using ReasonReact on top of ReasonML and I’m trying to output some emojis like this:

      (ReasonReact.string("Fire 🔥"))

but the output is:

Fire 🔥

The solution I found is to use the funky looking “Js string" instead of double quotes. The Js string in ReasonML has curlies and pipes with a js in the middle {js| Fire 🔥 |js}

In context it looks like this:

(ReasonReact.string({js| Fire 🔥 |js}))

And now I can see some fire:

Fire 🔥 
See More #reasonml TILs