react native header height 1

react native header height

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

Here is what the above code is Doing:
1. We’re importing the useHeaderHeight hook from the @react-navigation/elements package.
2. We’re creating a constant called headerHeight and assigning it the value returned by the useHeaderHeight hook.

Now, we can use the headerHeight constant to set the height of the header in our stylesheet.

Similar Posts