React-native I18nManager.forceRTL doesn't applies changes in first app load

See original GitHub issue

Is this a bug report?

Probably!

Environment

Environment: OS: Linux 4.4 Node: 7.10.1 Yarn: 1.0.1 npm: 4.2.0 Watchman: 4.7.0 Xcode: N/A Android Studio: Not Found

Packages: (wanted => installed) react: 16.2.0 => 16.2.0 react-native: 0.52.2 => 0.52.2

Target Platform: Android

Expected Behavior

I have an app that created by awesome React-native and my layout designed to be in RTL mode. I’ve set up an option for forcing the layout to be RTL.

Actual Behavior

But my option doesn’t works in first app load after installing. This feature applies in second run I wrote this option in our index.js:

import React, { Component } from 'react';
import { I18nManager } from 'react-native';
import { Provider } from 'react-redux';

I18nManager.forceRTL(true);

class App extends Component {
  render() {
    return (
      <Provider store={store}>
        <PersistGate loading={null} persistor={persistor}>
          <MainStack />
        </PersistGate>
      </Provider>
    );
  }
}

export default App;

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:10
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

8reactions
matanelgabsicommented, Nov 1, 2018

Another workaround would be adding: I18nUtil.getInstance().allowRTL(this, false); to public void onCreate() { in your MainApplication.java file

6reactions
omidgharibcommented, May 3, 2018

I have a same issue. Is there any solution to force app to RTL ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

I18nManager.forceRTL doesn't applies changes in first app load
First you check current state with I18nManager.isRTL then forceRTL if not and restart with react-native-restart.
Read more >
React Native Community | Hi i'm implementing RTL in my app
I used I18nManager.forceRTL(true); to force RTL. Also used the package react-native-restart for restarting the app in order to apply the RTL. It is...
Read more >
Building Component Libraries for React Native Apps - Medium
The I18nManager.forceRTL API changes your app to render in RTL mode so you can see how everything looks when using RTL languages. When...
Read more >
React Native i18n with Expo and i18next - Part 1 | Phrase
In production the switch should realistically only happen on the first load of our app, since the majority of users don't change their...
Read more >
Right-to-Left Layout Support For React Native Apps
In I18nManager , there is a constant isRTL to tell if layout of app is RTL or not, so that you can make...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found