Replies: 1 comment 3 replies
-
I ran into this exact same thing. Would be really nice if it didn't throw an error outside of the context of the bottom tab nav and returned |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In our app, we have a navigation flow that goes in and out of our bottom tab bar navigator. In this flow, we want to use a common hook for some display logic. However, using the useBottomTabBarHeight hook causes an app crash when used outside the tab bar navigator.
The code for the useBottomTabBarHeight just exposes the context value for the tab bar height if it's available, and throws if it isn't.
So that's my question - why does the hook need to throw outside its intended context? I think returning
undefined
would be pretty explicit, and would be easy to guard against on our side.Beta Was this translation helpful? Give feedback.
All reactions