0

I'm new to React Native and I tried to create a text with an inline text as follows:

<Text style={{textDecorationLine: 'line-through'}}>
    $75.00{'     '}
    <Text style={{textDecorationLine: 'none'}>$50</Text>
</Text>

The problem is that it renders

$75.00 $50.00

and not

$75.00 $50.00

I've seen that there's a workaround in html, is there a similar solution for React Native?

  • Note: I tried to make the strikethrough appear in a code section but this feature seems to not work anymore.
MikeL
  • 2,756
  • 2
  • 23
  • 41

1 Answers1

2

You can write your code in following way

<Text>
      <Text style={{textDecorationLine: 'line-through'}}>$75.00</Text> 
      <Text style={{textDecorationLine: 'none'}}>$50</Text>
</Text>
Abhi nav
  • 184
  • 5