Skip to content

[RNScreens] Unsupported orientation mask on iOS #3473

@rahimn20

Description

@rahimn20

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:

Image

Steps to reproduce

  1. Create a React Native project on 0.80.0 using React Navigation with @react-navigation/native-stack.
  2. Add a screen configured with the orientation option:

<Stack.Screen name="AnyScreen" component={AnyScreen} options={{ gestureEnabled: false, orientation: 'landscape_right', }} />

  1. Launch the app on iOS
  2. Navigate to the screen configured above.
  3. Observe that the app logs or throws the following error:

[RNScreens] Unsupported orientation mask

  1. Notice that the orientation is not applied to the screen.
  2. 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 iOSRepro providedA reproduction with a snack or repo is provided

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions