Display line break content in React with just CSS
Let's say you have an array of strings and you want to display its content inside a paragraph:
That will display all the items inline even if the line break is present :
Location 1 Location 2
Instead of adding unnecessary <br />
tags to the markup you can simply specify a css property to render line breaks:
This will look like:
Location 1
Location 2