Conditional rendering of string var

As shown below, I have a text that renders text in this manner. address, additionalInfo … Read more Conditional rendering of string var

As shown below, I have a text that renders text in this manner.

address, additionalInfo

<Text subtitle gray>
  {address} ", "
  {additionalInfo}
</Text>

However I want to re-write it so that the text will render

address,
additionalInfo

But if {additionalInfo}=null I want it to render

address

^without the linebreak.

How do I go about doing this?

Thanks in advance

Source: React – Stack Overflow



Leave a Reply

Your email address will not be published. Required fields are marked *