expo: [SDK 50] Dynamically overriding RTL settings causes the app to continuously reload
Minimal reproducible example
https://snack.expo.dev/@subhi2006/rtl-loop-demo-run-in-sdk-50
Summary
The previously working method (on SDK 49) of
const shouldBeRTL = true;
if (shouldBeRTL !== I18nManager.isRTL && Platform.OS !== 'web') {
I18nManager.allowRTL(shouldBeRTL);
I18nManager.forceRTL(shouldBeRTL);
Updates.reloadAsync();
}
That is specified in Dynamically overriding RTL settings results in the app continuously reloading as shown when updating to SDK 50
This only affects iOS
Note: Snack does not support SDK 50 and the demo above runs on SDK 49, the expo-updates
library should be changed according to the version of the SDK in use and it is possible that the error could be caused by the update to the library itself the error is caused when updating to expo@50.0.0-alpha.0
Environment
expo-env-info 1.2.0 environment info: System: OS: Windows 11 10.0.22621 Binaries: Node: 21.4.0 - F:\nodejs\node.EXE npm: 10.2.0 - F:\nodejs\npm.CMD npmPackages: expo: ~50.0.2 => 50.0.2 react: 18.2.0 => 18.2.0 react-native: 0.73.2 => 0.73.2 Expo Workflow: managed
About this issue
- Original URL
- State: open
- Created 5 months ago
- Comments: 39 (7 by maintainers)
I’m starting to think about adding a
forceRTL
field to theextra
field that would force the app to run in RTL regardless of OS language.Would that be helpful for you, or do you need this to be dynamically configurable?
Sorry for the lack of traffic on this issue – working on a PR to both add the
forcesRTL
flag and fix any weird config plugin behaviour. In the meantime, you can removeexpo-localization
plugin from the list ofplugins
in app.json if you don’t need automatic locale detection for RTL support and you can use the dynamic configuration.Yes aleqsio that would be great indeed for applications that only support RTL which are plenty and would justify adding said variable. However I think having the option to switch between RTL and LTR is essential for applications that switch between locales, so better documentation explaining what supportsRTL does and a modification of the Dynamically overriding RTL section would be much appreciated.
@Mahmoudkhoder01 either you remove the “supportsRTL”: true from your app config or you delete the expo-localization library from your app
Was able to repro, taking a look.
I can confirm that this happens to me as
I18nManager.allowRTL
andI18nManager.forceRTL
don’t seem to do anything on Expo Go as well as production builds.