Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"textAlignVertical" is not a valid style property

Tags:

react-native

I am getting an error saying "textAlignVertical" is not a valid style property when attempting to use the 'textAlignVertical' style on a Text element. I've checked the documentation and it says I should be able to use this style property: https://facebook.github.io/react-native/docs/text.html

has anyone else had this issue?

like image 270
Eric Avatar asked Jan 23 '16 22:01

Eric


1 Answers

The textAlignVertical style is an Android-only property. If you are developing on iOS, try using the flexbox alignment property alignItems: center instead.

It also appears that the textAlignVertical property was moved from TextInput properties to the Text element styles only three days ago, and is going to be released in React Native 0.19.

I am not sure how the React Native documentation is generated, but based on my reading of this commit diff, the documentation appears to be ahead of the latest released version.

like image 95
jevakallio Avatar answered Sep 24 '22 03:09

jevakallio