How to insert a newline symbol when a string is output

in the string given to me by the background, if a newline is n / r, how can I insert a newline symbol such as br when I use it? it is not good for me to write it directly in the string, just as the string is output to me

.
<div >
    {state.list[curIndex].remark}
</div>

Mar.12,2021

set innerText to use

\n

set innerHTML to use

<br>

react template is equivalent to innerText, should be used\ n


it's okay to write this step directly in the string, but the problem is that you end up parsing with html instead of string parsing.


disassemble according to < br/ >, and then concatenate the string

Menu