react replace n with br code example
Example: react replace all line breaks with br
{
string.split('\n').map((line, i) => (
<span key={i}>
{line}
<br/>
</span>
))
}
{
string.split('\n').map((line, i) => (
<span key={i}>
{line}
<br/>
</span>
))
}