Nivedita Pandey
Nivedita Pandey

Reputation: 21

React-native support RTL and LTR without changing device language

I have used react-native-i18n package for supporting international language. It is working but now I want my application can change RTL and LTR inside application according to language without changing device language. I used native base components in my application. So I cannot change their styling and If it is possible then How?

I have created settings option to change language and it is changing but how to change LTR to RTL and RTL to LTR all the components of application. If there is any solution please let me know.

Upvotes: 2

Views: 2619

Answers (1)

Fareed Alnamrouti
Fareed Alnamrouti

Reputation: 32174

from the react-native docs:

direction specifies the directional flow of the user interface. The default is inherit, except for root node which will have value based on the current locale.

this means if you change the top View style direction to "rtl" all child components should inherit the direction.

Upvotes: 2

Related Questions