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

Height invalid from useWindowDimensions #231

Open
AlexandreMouyen opened this issue May 28, 2021 · 0 comments
Open

Height invalid from useWindowDimensions #231

AlexandreMouyen opened this issue May 28, 2021 · 0 comments

Comments

@AlexandreMouyen
Copy link

Hello there,

I am using the height value from useWindowDimensions in Expo.
I am on an iPhone 10 so height is 812, most of the time. But there are sometimes where the hook returns 70 instead of 812.

const { height } = useWindowDimensions();
const { bottom, top } = useSafeAreaInsets();
const bottomOffset = height - bottom - 40;

console.log(`${height} - ${bottom} - 40 = ${bottomOffset}`);

Working result is "812 - 34 - 40 = 738" and sometimes I have "70 - 34 - 40 = -4".

Does somebody know about this?

Thanks.

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

1 participant