I have an array of HTML strings:
["<h1>this is a title</h1>", "<a href=#>link</a>", "<img src="#" />","<p>a long paragraph</p>"]
How would I convert these into an array of HTML tags, I'm ultimately trying to return the array to render in React.
I've tried using:
new DOMParser().parseFromString(string, "text/xml");
but that creates an array of douments. Obviously I can't use innerHTML because of the img and a href tags.
new DOMParser().parseFromString(youArray.join(','), "text/xml")