I have this code which is obviously not working:
_.each(matches, (match) ->
string = string.replace(match, ->
<span className="match" key={i++}>{match}</span>
)
)
Because that would result into a string mixed with objects. Bad I know. But how can I add React components inside a string? All I want is to highlight parts of a string with a react component. A tough case to crack I guess.