0

I have a text area where I write something, but when I display the text in a paragraph it don't do the text break after pressing enter, this is the code (simplified):

const formInputs = {
   biografia: ''
}

<textarea value={formInputs.biografia} placeholder='Biografia' type="text" />
<p>{formInputs.biografia}</p>

Now if I write in the text area this:
Hi, my name is Gabriele.
I'm from Milan.

In the paragraph It show me this:
Hi, my name is Gabriele. I'm from Milan.

How can I tell to the text area to have a break when I press the "enter" button?

  • Think it's a duplicate of this one: https://stackoverflow.com/questions/40417527/how-do-i-preserve-line-breaks-when-getting-text-from-a-textarea/40426477#:~:text=The%20easiest%20solution%20is%20to,as%20inside%20a%20. – Ivo Jan 31 '22 at 09:38

0 Answers0