I called lockToLandscapeRight锛宎nd the orientation has changed successfully. But if the modal is shown, it will thrown the following error:
Exception thrown while executing UI block: Supported orientations has no common orientation with the application, and [RCTModalHostViewController shouldAutorotate] is returning YES
react-native: 0.48.2
react-native-orientation: 3.1.0
Solved by add property supportedOrientations={['portrait', 'landscape', 'landscape-left', 'landscape-right']} to modal.
Most helpful comment
Solved by add property
supportedOrientations={['portrait', 'landscape', 'landscape-left', 'landscape-right']}tomodal.