Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Options orientation didn't work #10275

Closed
5 of 12 tasks
IlanZ93 opened this issue Jan 19, 2022 · 7 comments
Closed
5 of 12 tasks

Options orientation didn't work #10275

IlanZ93 opened this issue Jan 19, 2022 · 7 comments

Comments

@IlanZ93
Copy link

IlanZ93 commented Jan 19, 2022

Current behavior

I would like to lock orientation in landscape mode on one screen (chart screen).

But when i try to add options orientation to this Stack, it doesnt work...

<Stack.Navigator
      initialRouteName="Quotes"
      screenOptions={{headerShown: false}}>
      <Stack.Screen options={{ orientation: 'landscape' }} name="DetailQuote" component={DetailQuoteScreen} />
      <Stack.Screen name="Quotes" component={QuotesScreen} />
    </Stack.Navigator>

Capture d’écran 2022-01-19 à 10 17 13

Expected behavior

I saw that options={{ oriention: 'landscape' }} is a correct options in the doc but dont work there.

Reproduction

Sorry i cant reproduce this on snack right now

Platform

  • Android
  • iOS
  • Web
  • Windows
  • MacOS

Packages

  • @react-navigation/bottom-tabs
  • @react-navigation/drawer
  • @react-navigation/material-bottom-tabs
  • @react-navigation/material-top-tabs
  • @react-navigation/stack
  • @react-navigation/native-stack

Environment

  • I've removed the packages that I don't use
package version
@react-navigation/native "^6.0.6"
@react-navigation/bottom-tabs "^6.0.9"
@react-navigation/stack "^6.0.11"
react-native-safe-area-context "^3.3.2"
react-native-gesture-handler "^1.10.3"
react-native-reanimated "^2.2.4"
react-native "0.64.2"
npm 7.10.0
@IlanZ93 IlanZ93 added the bug label Jan 19, 2022
@github-actions
Copy link

Hey! Thanks for opening the issue. The issue doesn't seem to contain a link to a repro (a snack.expo.dev link or link to a GitHub repo under your username).

Can you provide a minimal repro which demonstrates the issue? A repro will help us debug the issue faster. Please try to keep the repro as small as possible and make sure that we can run it without additional setup.

@github-actions
Copy link

Couldn't find version numbers for the following packages in the issue:

  • @react-navigation/drawer
  • @react-navigation/material-bottom-tabs
  • @react-navigation/material-top-tabs

Can you update the issue to include version numbers for those packages? The version numbers must match the format 1.2.3.

@satya164
Copy link
Member

orientation is only available in @react-navigation/native-stack as documented, not in @react-navigation/stack

@github-actions
Copy link

Hey! This issue is closed and isn't watched by the core team. You are welcome to discuss the issue with others in this thread, but if you think this issue is still valid and needs to be tracked, please open a new issue with a repro.

@ScreamZ
Copy link

ScreamZ commented Feb 5, 2023

@satya164 I'm trying with native stack navigator and expo app, but doesn't seems to work too… any idea ?

@getnashty
Copy link

@ScreamZ , and for anyone else using Expo who stumbles upon this... https://docs.expo.dev/versions/latest/sdk/screen-orientation/#example-appjson-with-config-plugin Expo has its own handling for orientation..

@anupsamanta
Copy link

anupsamanta commented May 10, 2024

@react-navigation/native-stack

Not working also with @react-navigation/native-stack. Instead you can use "react-native-orientation-locker" npm library

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants