简体   繁体   中英

What is {' '} in react-native?

I was working on a collaborative project and there is a lot of {' '} used.

Examples -

<Text>
     {' '}
     {constant.Messages.PointText.hey} {this._user.first_name || this._user.business_name}!{' '}
</Text>
<Text>
     {' '}
     {constant.Messages.PointText.redeem}{' '}
</Text>

constant. is text as a constant.

您可以使用 {' '} 插入有意的空格(或制表符、换行符等)。

它将在 dom 中添加一个空白空间。

This is used to put an explicit space in a text block, since leading and trailing spaces are ignored at compile/transformation time when there is another tag.

refer this SO Question

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM