how to replace \n to </br> in react 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>
))
}