using drawer navigation with stacknavigator react native code example
Example 1: react native drawer navigation example
import * as React from 'react';
import { Button, View } from 'react-native';
import { createDrawerNavigator } from '@react-navigation/drawer';
import { NavigationContainer } from '@react-navigation/native';
function HomeScreen({ navigation }) {
return (
);
}
function NotificationsScreen({ navigation }) {
return (
);
}
const Drawer = createDrawerNavigator();
export default function App() {
return (
);
}
Example 2: put stacknavigator in drawernvigator
Home: { navigationOptions: { drawerIcon: ({ tintColor }) => ( ), drawerLabel: "Home" }, screen: Home},