Search code examples
react-nativeorientationscreen-orientationautorotate

React Native Orientation does not listening Current System Auto Rotate Status


Im using react-native-orientation . I want to lock initial login screen in portrait mode. so i have used Orientation.lockToPortrait() in app.tsx ,and Orientation.unlockAllOrientations() in a screen's constructor that i want to enable rotation again.

But the problem is when Device/emulators system auto rotate Disabled from notification bar it still rotates.I want to rotate if Device/emulators system auto rotate enabled. otherwise not.

So is there any way to listen system/device rotation status? or any suggestion?


Solution

  • react-native-orientation the package dont have such feature react-native-orientation-locker solved my problem.