To turn off the header in createDrawerNavigation for React Navigation within React Native, you can use the headerMode
option and set it to "none"
in the StackNavigator
that the drawer navigator is nested in. Here's an example:
import { createDrawerNavigator } from 'react-navigation-drawer';
import { createStackNavigator } from 'react-navigation-stack';
import HomeScreen from './screens/HomeScreen';
import ProfileScreen from './screens/ProfileScreen';
const AppNavigator = createStackNavigator(
{
Home: { screen: HomeScreen },
Profile: { screen: ProfileScreen },
},
{
headerMode: 'none',
}
);
const DrawerNavigator = createDrawerNavigator(
{
App: AppNavigator,
},
{
// drawer options
}
);
export default DrawerNavigator;
In this example, the AppNavigator
stack navigator has the headerMode
option set to "none"
. This removes the header from all screens in the stack navigator, which includes the screens that are displayed in the drawer navigator. Therefore, the header will also be removed from the drawer navigator screens.
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2023-03-15 11:00:00 +0000
Seen: 12 times
Last updated: Oct 20 '21
How can I highlight the home navigation when I am on a subroute, such as blog/post, in Next.js?
How can I include a right-click action for the navigation menu in Angular?
What is the method of incorporating restorable push navigation with the get package in Flutter?
How to stop the navigation bar from rebuilding during navigation in Flutter's widget structure?
What is the process of personalizing the navigation title view for a MAUI ContentPage?
What is the process for using a module to include a new block in the navigation of Prestashop?
Is it possible to turn off type errors from third-party packages in Pylance?
How to turn off the automatic update feature of Google Chrome on Windows 11?