Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add a copyright symbol in reason-react component?

I’m new to reason-react. I’m trying to put a copyright symbol in a react-reason component. I've tried

<span >(ReasonReact.stringToElement("&copy;"))</span>

but this doesn’t give me the © symbol.

like image 812
bonheury Avatar asked Feb 28 '18 22:02

bonheury


2 Answers

Simply put: &copy; if you don't put ; it will not work

like image 143
Walid Bezoui Avatar answered Oct 07 '22 12:10

Walid Bezoui


If you're doing HTML entities like that you have to use the dangerouslySetInnerHTML attribute like so:

<span dangerouslySetInnerHTML={{ "__html": "&copy;" }} />
like image 41
Neil Kistner Avatar answered Oct 07 '22 13:10

Neil Kistner