I'm looking to add a line break to the following array. Using \n doesn't seem to work.
const output = {
message: [
`Hello world\n Hello again!`
]
}
Is there a way to add line breaks in arrays? I tried mapping through the array and adding some HTML but didn't have much success there as I couldn't figure out how to separate the "Hello World" and "Hello again" messages:
const displayOutput = output.message.map((messages, id) =>
<p key={id} className="output-message">
{messages}
</p>
);
Thanks for any help!
` or css styling – Patrick Evans Mar 18 '21 at 00:15