Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Text Indentation on React Native

I need to indent the first line of a paragraph on React Native. But the use of the common css text-indent property (textIndent) isn't compatible with React Native, and neither are pseudo-element selectors (like :first-line). Is there any way to do this without wrapping the whole line in <Text> tags and defining its own style? Which words will end up in the first line of a paragraph is somewhat indeterministic from one device's viewport to another device's viewport.

like image 847
shmuli Avatar asked May 16 '17 07:05

shmuli


1 Answers

Use {'\t'}. Just like this: <Text>{'\t'}Hi there</Text>

like image 130
Xr.Lin Avatar answered Sep 20 '22 15:09

Xr.Lin