yamill/react-native-orientation

Locking to Portrait on app launching rotates from Landscape to Portrait (iOS)

vladinko0 opened this issue · 2 comments

I want to lock the orientation of the first screen of app to Portrait. But when I launch the application I see for a while landscape orientation and then quickly rotating to the Portrait orientation. Next screens are okey.

Here is my code:

componentDidMount() {
        Orientation.lockToPortrait();
    }

Is it possible to solve this performance issue?

It was my error.
I used in one class redundant code:

  const setLandscapeRightOrientation = Platform.select({
       ios: Orientation.lockToLandscapeRight(),
       android: Orientation.lockToLandscapeLeft(),
   });