I get a list of objects from the API. One of the values of each object is a plain string:
snippet: "Chainsmokers were re-formed as an EDM DJ duo in 2012 under the management of <span class="searchmatch">Adam</span> Alpert in New York City. Pall, who had grown up DJing, was introduced to"
I'd like to convert this plain string to be interpreted as html. How do I do that?
Edit: What I try to do is map over a list in React like so:
const list = props.responseData.map(item => (
<li key={item.pageid}>
{item.title}
<br />
{item.snippet}
</li>
));
The snippet one is displayed as a plain string, not as HTML code. Writing item.snippet.innerHTML doesn't work. It displays an empty list.