Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flex direction: row-reverse in react-native

How can i reproduce flex-direction: row-reverse in React-Native? When in element' style i'm doing:

 flexDirection: 'row-reverse'

i'm getting error:

Invalid prop flexDirection of value row-reverse supplied to StyleSheet

UPDATE: They just added it in version 0.29.0 :)

like image 600
Ivan Chernykh Avatar asked Jul 15 '16 22:07

Ivan Chernykh


People also ask

How do you use Flex direction row in React Native?

Flex DirectionBy default, React Native lays out with LTR layout direction. In this mode start refers to left and end refers to right. LTR (default value) Text and children are laid out from left to right. Margin and padding applied to the start of an element are applied on the left side.

What is Flex row-reverse?

The flex container's main-axis is defined to be the same as the text direction. The main-start and main-end points are the same as the content direction. row-reverse. Behaves the same as row but the main-start and main-end points are opposite to the content direction. column.

How do I change the direction of my flex in react?

Use align-items utilities on flexbox containers to change the alignment of flex items on the cross axis (the y-axis to start, x-axis if flex-direction: column ). Choose from start , end , center , baseline , or stretch (browser default).

How do you reverse a element in Flex?

Reverse the display of the itemsrow-reverse. column-reverse.


1 Answers

UPDATE

As of v29, React Native provides support for reverse flex directions in Android and iOS. https://github.com/facebook/react-native/releases/tag/v0.29.0


ORIGINAL ANSWER

There is no row-reverse or column-reverse in react-native.

See this table of supported attributes:

enter image description here

https://github.com/facebook/css-layout

like image 62
Michael Benjamin Avatar answered Sep 20 '22 11:09

Michael Benjamin