react-native中的区域设置切换

react-native中的区域设置切换,react-native,React Native,我正在构建一个react本地应用程序,它支持英语和阿拉伯语区域设置,我的问题是,在用户登录到我的应用程序之前,用户区域设置是未知的。我的问题是,当用户登录到我的应用程序时,如何在不重新启动我的应用程序的情况下将区域设置从英语切换到阿拉伯语 我切换区域设置的代码是: I18nManager.forceRTL(!this.state.isRTL); this.setState({isRTL: !this.state.isRTL}); // problem is that it requires re

我正在构建一个react本地应用程序,它支持英语和阿拉伯语区域设置,我的问题是,在用户登录到我的应用程序之前,用户区域设置是未知的。我的问题是,当用户登录到我的应用程序时,如何在不重新启动我的应用程序的情况下将区域设置从英语切换到阿拉伯语

我切换区域设置的代码是:

I18nManager.forceRTL(!this.state.isRTL);
this.setState({isRTL: !this.state.isRTL});
// problem is that it requires restarting and i think restarting my app when user is logging in isn't a good practice.
任何人都有一个好的解决方案或关于如何实施一个好的解决方案的建议。

看看