I am using react-navigation
with my react native app. I have created a bottom tab navigator, and want to use the built in header on my screen. But the header is not showing up. There are no errors or warnings.
app.js:
const TabStack = createBottomTabNavigator({
Upload: {
screen: upload,
navigationOption: {
headerTitle: "Upload"
}
},
Profile: {
screen: profile,
navigationOption: {
headerTitle: "Profile"
}
}
});
const MainStack = createSwitchNavigator(
{
Home: { screen: TabStack }
},
{
initialRouteName: 'Home'
}
);
upload.js
class upload extends React.Component {
static navigationOptions = {
title: 'Upload'
};
constructor(props) {
super(props);
...
I know declaring navigationOptions
in the components is probably not needed since it is already declared in app.js but this is just to show that neither approach works.
How do I fix this?