-
-
Notifications
You must be signed in to change notification settings - Fork 606
Closed
Labels
Platform: iOSThis issue is specific to iOSThis issue is specific to iOSRepro providedA reproduction with a snack or repo is providedA reproduction with a snack or repo is provided
Description
Description
After upgrading a project from React Native 0.73.11 → 0.80.0, screen components that previously used the orientation option inside React Navigation now throw the following runtime error:
Steps to reproduce
- Create a React Native project on 0.80.0 using React Navigation with @react-navigation/native-stack.
- Add a screen configured with the orientation option:
<Stack.Screen name="AnyScreen" component={AnyScreen} options={{ gestureEnabled: false, orientation: 'landscape_right', }} />
- Launch the app on iOS
- Navigate to the screen configured above.
- Observe that the app logs or throws the following error:
[RNScreens] Unsupported orientation mask
- Notice that the orientation is not applied to the screen.
- If the issue does not reproduce initially, try navigating back from this screen using:
navigation.reset({ index: 0, routes: [{ name: 'SomeOtherScreen' }], });
instead of navigation.goBack().
The error consistently appears when the screen is mounted again via navigation.reset()
Snack or a link to a repository
https://github.com/rahimn20/RNScreensOrientationBug
Screens version
4.18.0
React Native version
0.80.0
Platforms
iOS
JavaScript runtime
Hermes
Workflow
React Native (without Expo)
Architecture
Paper (Old Architecture)
Build type
Debug mode
Device
Real device
Device model
iPhone 14 pro
Acknowledgements
Yes
Metadata
Metadata
Assignees
Labels
Platform: iOSThis issue is specific to iOSThis issue is specific to iOSRepro providedA reproduction with a snack or repo is providedA reproduction with a snack or repo is provided