There are now safer methods to render HTML. I covered this in a previous answer here. You have 4 options, the last uses dangerouslySetInnerHTML.
Methods for rendering HTML
-
Easiest – Use Unicode, save the file as UTF-8 and set the
charsetto UTF-8.<div>{'First ยท Second'}</div> -
Safer – Use the Unicode number for the entity inside a Javascript string.
<div>{'First \u00b7 Second'}</div>or
<div>{'First ' + String.fromCharCode(183) + ' Second'}</div> -
Or a mixed array with strings and JSX elements.
<div>{['First ', <span>·</span>, ' Second']}</div> -
Last Resort – Insert raw HTML using
dangerouslySetInnerHTML.<div dangerouslySetInnerHTML={{__html: 'First · Second'}} />