react-navigation / react-navigation

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

Wrong header height value for screens inside Native Stack inside another Native Stack with modal presentation on iOS #11945

Open SrAnthony opened 1 month ago

SrAnthony commented 1 month ago

Current behavior

Screens inside a Native Stack that is inside another presentation: 'modal' Native Stack have the header height value from the useHeaderHeight() hook incorrect on iOS (double what it should be).

This type of nesting happens when I want to show a modal with a stack of screens inside.

IMG_AB04CA659CE7-1

Expected behavior

The useHeaderHeight() hook should return the correct value for the header height on this situation.

Reproduction

https://snack.expo.dev/@sranthony/react-navigation-header-height-bug

Platform

Packages

Environment

package version
@react-navigation/native 6.1.17
@react-navigation/native-stack 6.9.26
react-native-screens 3.29.0
react-native 73
expo 50