Locking to Portrait on app launching rotates from Landscape to Portrait (iOS)
vladinko0 opened this issue · 2 comments
vladinko0 commented
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?
retyui commented
This repo dead , use the fork https://github.com/wonday/react-native-orientation-locker
vladinko0 commented
It was my error.
I used in one class redundant code:
const setLandscapeRightOrientation = Platform.select({
ios: Orientation.lockToLandscapeRight(),
android: Orientation.lockToLandscapeLeft(),
});