react-navigation / react-navigation

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

fix: use measured header height when exposing it #11917

Closed satya164 closed 1 month ago

satya164 commented 1 month ago

Motivation

Currently the useHeaderHeight hook returns a hardcoded value since previously we didn't have a way to measure the header height. But now there's a onHeaderHeightChange listener that we can use to measure the accurate height.

This PR makes sure that we use this event when measuring header height.

Test plan

Tested in the example app:

https://github.com/react-navigation/react-navigation/assets/1174278/c6e415eb-3cba-4e65-8717-9fd2d03f8987

github-actions[bot] commented 1 month ago

The Expo app for the example from this branch is ready!

https://expo.dev/@react-navigation/react-navigation-example?serviceType=eas&distribution=expo-go&scheme=exp+react-navigation-example&channel=pr-11917&sdkVersion=50.0.0

netlify[bot] commented 1 month ago

Deploy Preview for react-navigation-example ready!

Name Link
Latest commit 8438e400f4952354909a93bac5d5c46ba80a0b86
Latest deploy log https://app.netlify.com/sites/react-navigation-example/deploys/66070fe6c93a1e00081cf24f
Deploy Preview https://deploy-preview-11917--react-navigation-example.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

codecov-commenter commented 1 month ago

Codecov Report

Attention: Patch coverage is 34.48276% with 19 lines in your changes are missing coverage. Please review.

Project coverage is 77.05%. Comparing base (1d5ee6e) to head (78e7d29).

:exclamation: Current head 78e7d29 differs from pull request most recent head 8438e40. Consider uploading reports for the commit 8438e40 to get more accurate results

Files Patch % Lines
.../native-stack/src/views/NativeStackView.native.tsx 33.33% 16 Missing :warning:
packages/native-stack/src/utils/debounce.tsx 40.00% 3 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #11917 +/- ## ========================================== - Coverage 77.24% 77.05% -0.20% ========================================== Files 209 210 +1 Lines 6312 6336 +24 Branches 2496 2506 +10 ========================================== + Hits 4876 4882 +6 - Misses 1382 1400 +18 Partials 54 54 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.