1

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.

Piyushh
  • 573
  • 4
  • 16

3 Answers3

3

You can use {' '} syntax to insert intentional whitespace (or tabs, newlines, etc).

Audwin Oyong
  • 2,247
  • 3
  • 15
  • 32
Hamid Shoja
  • 3,838
  • 4
  • 30
  • 45
2

It will add an empty space into the dom.

William Park
  • 1,697
  • 1
  • 12
  • 17
1

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

bajran
  • 1,433
  • 14
  • 23
  • 1
    There is an option under question to flag as a duplicate. This is the way to go instead of quoting inside a new answer, unless you want to add relevant additional information. – Emile Bergeron Jan 10 '20 at 18:58