Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

251
Views
How to get React to parse new lines from components?

How do I get React to parse new lines given by a component?

Something like <ComponentWhichReturnsText /> in a return in a functional component seemingly ignores if that component has \n in it.

Minimal reproducible example: CodeSandbox

Expected result:

Text line 1
Text line 2

Actual result:

Text line 1 Text line 2

Also, when giving your answers, please keep the same structure. The text I have must come from a component and that component must be directly rendered in my App's return. Something which can be modified is the text (so for example inserting characters to get the new lines to parse).

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!