Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

react replace all line breaks with br

{
    string.split('
').map((line, i) => (
        <span key={i}>
            {line}
            <br/>
        </span>
    ))
}
 
PREVIOUS NEXT
Tagged: #react #replace #line #breaks #br
ADD COMMENT
Topic
Name
9+6 =