HTML Entities in ReasonML/ReasonReact


How do you render HTML entities to the DOM using ReasonML/ReasonReact?


See Stack Overflow: How to add a copyright symbol in reason-react component?


It looks like this works for only a certain set of characters at the moment. I was trying to create menu bars:


Ah, I have to use dangerouslySetInnerHTML={{ "__html": "☰" }}. Didn’t want to have to do that but oh well.


I don’t see why that wouldn’t work with just Unicode, but yeah if you have to emit actual HTML entities then you have to wrap it in another element.

This is an issue with React, not Reason or ReasonReact, btw, so other solutions might be, or become, possible if React enables them.