React Navigation get stack header height

React navigation V6

import { useHeaderHeight } from '@react-navigation/elements';
const headerHeight = useHeaderHeight();

React navigation V5

import { useHeaderHeight } from '@react-navigation/stack';
const headerHeight = useHeaderHeight();

or with React Context’s API (not recommended)

React navigation V4

import { Header } from 'react-navigation-stack';
const headerHeight = Header.HEIGHT;

React navigation V2-V3

import { Header } from 'react-navigation';
const headerHeight = Header.HEIGHT;

Another answer to this problem

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)