React component to render price change
It is equivalent to:
const renderPriceChange = (price) =&gt; {
  return (
    &lt;Text style={price &gt; 0 ? styles.rise : styles.drop}&gt;
      &lt;AntDesign
        name={price &gt; 0 ? 'caretup' : 'caretdown'}
        color={price &gt; 0 ? '#03AE9D' : '#fb2c33'}
        size={10}
      /&gt;{' '}
      {percentageFormat(item.price_change_percentage_24h)}%
    &lt;/Text&gt;
  )
}

You can inline the if...else by using JavaScript's ternary operator a ? b : c