Let's suppose you get from an API a string like this:
to do so it is quite easy, just do it in this way
{
"text": "FEATURES\n•Contrary to popular belief, Lorem Ipsum is not simply random .\n•BC, making it over 2000 years old. Richard McClintock, a Latin .\n•There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form.\n•If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text." } |
FEATURES
•Contrary to popular belief, Lorem Ipsum is not simply random . •BC, making it over 2000 years old. Richard McClintock, a Latin . •There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form. •If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. |
to do so it is quite easy, just do it in this way
item.texto.split('\n').map((item, i) => {
return <p key={i}>{item}</p>;
})
|
replace the item by the array name you've got from your API or variable.
Comments
Post a Comment