Reputation: 21
I am trying to do something like
h(Modal.Title, " ")
where h is the react-hyperscript method used in javascript.
I want that the html renders
<span class="abc"> </span>
But it is actually doing:
<span class="abc">&nbsp;</span>
Upvotes: 2
Views: 405
Reputation: 5164
In order to render HTML entities, or any raw HTML for that matter, you need to use React's dangerouslySetInnerHTML
property:
h(Modal.Title, {dangerouslySetInnerHTML: {__html: " "}})
Read more about it in the React documentation here.
Upvotes: 1