For some reason I am not able to remove the header at the very top of my React Native app (see screenshot).
The app itself is contained in the AppMain
component:
const App = () => {
return (
<PrincipalContextProvider>
<AppMain />
</PrincipalContextProvider>
);
};
which produces this (note the white header at the top).
I am making use of components like react-navigation/native-stack
and react-navigation/bottom-tabs
which may produce something like this. But after setting screenOptions={{ headerShown: false }}
on everything, and even removing the app content entirely:
const App = () => {
return (
<View>
<Text>The text..</Text>
</View>
);
};
I’d still get this:
Apparently, there’s something else causing this and I am not sure what.
2
Answers
What happens when you set the
flex
andheight
?The solution is not to put it in a
Screen
component, put it in your navigatorStack.Navigator
instead