import { useWindowDimensions } from "react-native"; import { useSafeAreaInsets } from "react-native-safe-area-context"; import { useBottomTabBarHeight } from "@react-navigation/bottom-tabs"; import { useHeaderHeight } from "@react-navigation/elements"; export function useUsableHeight() { const insets = useSafeAreaInsets(); const { height: windowHeight } = useWindowDimensions(); const headerHeight = useHeaderHeight(); const tabBarHeight = useBottomTabBarHeight(); return ( windowHeight - insets.top - insets.bottom - headerHeight - tabBarHeight ); }