I\'m trying to replace parts of a string with JSX tags, like so:
render: function() { result = this.props.text.replace(\":\",
Wrote a utility function for jsx.
const wrapTags = (text: string, regex: RegExp, className?: string) => { const textArray = text.split(regex); return textArray.map(str => { if (regex.test(str)) { return {str}; } return str; }); };