I want to insert a new line (like \\r\\n,
) in a Text component in React Native.
If I have:
Hi~
this
Use:
<Text>{`Hi,\nCurtis!`}</Text>
Result:
Hi,
Curtis!
Use \n
in text and css white-space: pre-wrap;
You can try using like this
<text>{`${val}\n`}</text>
Just put {'\n'}
within the Text tag
<Text>
Hello {'\n'}
World!
</Text>
Just use {"\n"} where you want to break the line
<Text>
Hi~{"\n"}
this is a test message.
</Text>