How can I insert a line break into a component in React Native?

前端 未结 24 1884
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-28 18:04

I want to insert a new line (like \\r\\n,
) in a Text component in React Native.

If I have:



Hi~
this
24条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-28 18:39

    If at all you are displaying data from state variables, use this.

    {this.state.user.bio.replace('
    ', '\n')}

提交回复
热议问题