react-navigation / react-navigation

Routing and navigation for your React Native apps
https://reactnavigation.org
23.3k stars 4.97k forks source link

useHeaderHeight changes several times when orientation changes #11915

Closed Gregoirevda closed 2 weeks ago

Gregoirevda commented 1 month ago

Current behavior

In tablet, changing orientation causes the app to flicker and taking time to resize itself because many part of the app rely on a fairly static useHeaderHeight() value. (Including ScrollView contentContainerStyle and useEffects). When changing orientation, statusBarHeight goes from X to 0 and back to X. Causing many "re-layouts".

This only happens when going from landscape to portrait.

The reason is useSafeAreaInsets().top which goes from X to 0 to X.

Expected behavior

statusBarHeight should not jump to 0 when changing orientation

Reproduction

l

Platform

Packages

Environment

package version
@react-navigation/native
@react-navigation/native-stack
react-native-safe-area-context
react-native-screens
react-native
node
npm or yarn
github-actions[bot] commented 1 month ago

Hey @Gregoirevda! Thanks for opening the issue. It seems that the issue doesn't contain a link to a repro.

The best way to get attention to your issue is to provide an easy way for a developer to reproduce the issue.

You can provide a repro using any of the following:

github-actions[bot] commented 1 month ago

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

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

Gregoirevda commented 1 month ago

Opened an issue in react-native-safe-area context as the issue is coming from there https://github.com/th3rdwave/react-native-safe-area-context/issues/485

github-actions[bot] commented 3 weeks ago

Hello 👋, this issue has been open for more than a month without a repro or any activity. If the issue is still present in the latest version, please provide a repro or leave a comment within 7 days to keep it open, otherwise it will be closed automatically. If you found a solution or workaround for the issue, please comment here for others to find. If this issue is critical for you, please consider sending a pull request to fix it.