I want to set the username on a new line in my React tsx (TypeScript) web application.
Please upvote this question bec. it isn't too easy to find the solution in the internet so others also see the solution here :)
entry.comment
contains the following string: jsdkjfdjsfds
entry.username
contains the following string: Noah
My code looks like this, I tried with \n
but this isn't working:
<div className={classes.entryContent}>
<Typography className={classes.entryContentParagraph} variant="body2" paragraph={true}>
<ReactMarkdown>
{entry.comment "\n" entry.username}
</ReactMarkdown>
</Typography>
</div>
Do you have an advice? Stay fresh!
CodePudding user response:
According to this issue and to markdown conversions
will give you
but this
will give you
CodePudding user response:
Since I don't have enough reputation I have to add it in an answer.
I haven't worked with this library before but can you try adding the break-line tag, like <br />
.
CodePudding user response:
<div className={classes.entryContent}>
<Typography className={classes.entryContentParagraph} variant="body2" paragraph={true}>
<ReactMarkdown>
<p>{entry.comment}</p>
<p>{entry.username}</p>
</ReactMarkdown>
</Typography>
</div>