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

useDeviceOrientation screen bug #202

Closed
xuqianjin opened this issue Aug 6, 2020 · 11 comments
Closed

useDeviceOrientation screen bug #202

xuqianjin opened this issue Aug 6, 2020 · 11 comments

Comments

@xuqianjin
Copy link

Bug report

Summary

Environment info

react-native info output:

# "react-native": "^0.63.2",

Library version: ^2.6.0

orientation.landscape is always false when change orientation

@vicm159
Copy link

vicm159 commented Aug 9, 2020

I have the same issue was working fine until i upgrade to RN 0.63. We previously had RN version 0.62.2

@xuqianjin
Copy link
Author

I have the same issue was working fine until i upgrade to RN 0.63. We previously had RN version 0.62.2

that seems a RN bug not the hooks

@carolinex
Copy link

I can confirm that Dimensions are not updating on orientation change in RN 0.63, with or without use of useDeviceOrientation hook. If you downgrade to 0.62.2 it works as intended.

@NateRedding
Copy link

I hit this issue too. Looks like this hook is using the 'screen' dimensions. I was able to work around it by making my own hook based on the 'window' dimensions.

@shahiran250890
Copy link

Hi, I have issue with useDeviceOrientation() it does not return current orientation of my device and android emulator. How can i fix it?

@SorinGabriel02
Copy link

The fastest fix is to use useDimentions hook instead:

const { height, width } = useDimensions().window;
const landscape = width > height;

@poppyseedDev
Copy link

Thanks for the input!

The fastest fix is to use useDimentions hook instead:

const { height, width } = useDimensions().window;
const landscape = width > height;

@montagnev
Copy link

hello, I'll have a time next week to work on this, I'll try to fix useDeviceOrientation hook

@montagnev
Copy link

I just tested with the version 2.8.1 of the library and the version 0.67.4 of react-native and it works fine.

@LinusU
Copy link
Member

LinusU commented Mar 30, 2022

@montagnev thank you for testing this! ❤️

@LinusU LinusU closed this as completed Mar 30, 2022
@Taro-Naza
Copy link

I just tested with the version 2.8.1 of the library and version 0.67.4 of react-native and it works fine.

I'm using the version 2.8.1 and it is not working for me.

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

No branches or pull requests

10 participants