Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to add new line in jsx

const text = 'Tommy Vercetti 
 Carl Johnson'

// Inside our render function we want to loop through the string:
let newText = text.split('
').map(i => {
    return <p>{i}</p>
});

// The result :
Tommy Vercetti
Carl Johnson
Source by www.jsdiaries.com #
 
PREVIOUS NEXT
Tagged: #add #line #jsx
ADD COMMENT
Topic
Name
1+6 =