I have a text file that I'd like to convert to a JSX string using Regex and display on the browser as if it's a JSX markup manually entered in the render return () block.
Let's say I create a string
generatedString = '<span class="tag" style={divStyle}>Test string</span>'
and want to have it displayed in the browser by
render() {
<div> {generatedString} <div>
}
The browser shows
"<span_class="tag"_style={divStyle}>Test string</span>"
as a text string, instead of "Test string" with the style applied to it.