Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Text Component numberOfLines default value?

Tags:

react-native

I just want to know the default-value for numberOfLines attribute of the Text component ? something like 'auto' or 'initial' ...

<Text numberOfLines={selected ? 0 : 1}>{term}</Text>

term can some short or long Arabic text

const term = 'هذه الكلمات مكتوبه باللغه العربيه';

Any help ?

like image 448
Hend El-Sahli Avatar asked Dec 09 '25 09:12

Hend El-Sahli


1 Answers

There's no default value for numberOfLines. If you want to have infinite numberOfLines based of condition you can just put the number 0 to it:

numberOfLines={someCondition ? 1 : 0}
like image 192
Auticcat Avatar answered Dec 11 '25 23:12

Auticcat



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!