-
Notifications
You must be signed in to change notification settings - Fork 198
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 returns incorrect initial values #210
Comments
I see there is another opened issue for this. 8cfe3a5 I have updated solution taking into considetion points from solution above that is stucked.
Then it can be used like this:
Let me know if I can start testing and prepare pull request. |
A good first step that's non-controversial would be to move the If we want to change the return value we need to have some more discussions. If we change to a string, what should we return when the app is running on a square canvas? |
I know it's little bit ugly but this is only place where I would also move functions
|
Initial values returned by this hook can be incorrect based od how was app started and when hook mounted.
Example:
App is started in
portrait
, then orientation is chaged tolandscape
and after that this hook is mounted. It will show that device is in landscape.Not sure if this is by design or it's a bug.
My current solution looks like this:
The text was updated successfully, but these errors were encountered: