1

I am using React Navigation native v5[https://reactnavigation.org/docs/drawer-navigator#options], but Header is not showing why? May be I'm missing something.

 const Drawer = createDrawerNavigator();
  //==============================
  //===============Navigation Drawer===============
  //==============================
  return (

    <NavigationContainer>      
      <Drawer.Navigator 
      headerMode= "screen"
      title='Drawer Screen'
      initialRouteName="Home">
        <Drawer.Screen 
        name="Home" 
        component={DrawerHome}
        options={{          
        title: "Home",
            drawerIcon: () => (
              <Image source={require("./Images/hamburger.png")}
              style={{height: 20, width: 20}}
              /> ), 
          }}
        />
        <Drawer.Screen name="Profile" component={ProfileScreen} />
        <Drawer.Screen name="Settings" component={SettingsScreen} />
      </Drawer.Navigator>
    </NavigationContainer>

  );
}

1 Answer 1

1

Header is available in a Stack Navigator screen. If you need one, make a nested navigator to house ProfileScreen and SettingsScreen.

Or alternatively, add a custom header to the render method of ProfileScreen and SettingsScreen.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.