File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ import {
1010 TouchableOpacity ,
1111 Button ,
1212 Alert ,
13+ I18nManager ,
14+ DevSettings ,
1315} from 'react-native' ;
1416import { NavigationContainer , useNavigation } from '@react-navigation/native' ;
1517import { createStackNavigator } from '@react-navigation/stack' ;
@@ -121,6 +123,16 @@ export function Navigation() {
121123 color = "orange"
122124 />
123125 ) ,
126+ headerLeft : ( ) => (
127+ < Button
128+ title = { I18nManager . getConstants ( ) . isRTL ? 'RTL' : 'LTR' }
129+ color = "orange"
130+ onPress = { ( ) => {
131+ I18nManager . forceRTL ( ! I18nManager . getConstants ( ) . isRTL ) ;
132+ DevSettings . reload ( ) ;
133+ } }
134+ />
135+ ) ,
124136 } }
125137 />
126138 { examples . map ( ( example , index ) => (
Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ import {
1010 TouchableOpacity ,
1111 Button ,
1212 Alert ,
13+ I18nManager ,
14+ DevSettings ,
1315} from 'react-native' ;
1416import { NavigationContainer , useNavigation } from '@react-navigation/native' ;
1517import { createStackNavigator } from '@react-navigation/stack' ;
@@ -119,6 +121,16 @@ export function Navigation() {
119121 color = "orange"
120122 />
121123 ) ,
124+ headerLeft : ( ) => (
125+ < Button
126+ title = { I18nManager . getConstants ( ) . isRTL ? 'RTL' : 'LTR' }
127+ color = "orange"
128+ onPress = { ( ) => {
129+ I18nManager . forceRTL ( ! I18nManager . getConstants ( ) . isRTL ) ;
130+ DevSettings . reload ( ) ;
131+ } }
132+ />
133+ ) ,
122134 } }
123135 />
124136 { examples . map ( ( example , index ) => (
You can’t perform that action at this time.
0 commit comments