I am working on a Practice Project like Login/Register Application and I am using Stack Navigation from react-navigations and it's working perfect,
Now when User Login's he should be redirected to the Dashboard Screen where I want a Drawer to the right side of the header "I also added a screenshot" and I created the Dashboard Screen also in Stack Navigation I don't know How I can add that Drawer inside the Stack Navigation I just want Drawer on my Dashboard Screen so anyone who can help with that? Thanks
App.js (Where I added all Stack Screens)
import React from 'react';
import { createStackNavigator, createDrawerNavigator } from 'react-navigation';
import HomeScreen from './screens/HomeScreen';
import LoginScreen from './screens/LoginScreen';
import RegisterScreen from './screens/RegisterScreen';
import Dashboard from './screens/Dashboard';
const StackNavigation = createStackNavigator({
HomeStack: HomeScreen,
LoginStack: LoginScreen,
RegisterStack: RegisterScreen,
DashboardStack: Dashboard,
}, {
initialRouteName: 'HomeStack',
});
const DrawerNav = createDrawerNavigator({
DashboardStack: Dashboard,
})
export default class App extends React.Component {
render() {
return (
<StackNavigation />
);
}
}
Dashboard.js
import React from 'react';
import { Text, View, StyleSheet, TouchableOpacity } from 'react-native';
import Icon from 'react-native-vector-icons/FontAwesome';
export default class Dashboard extends React.Component {
static navigationOptions = {
headerTitle: 'Dashboard',
headerLeft: null,
headerTitleStyle: {
flex: 1,
color: '#fff',
textAlign: 'center',
alignSelf: 'center',
fontWeight: 'normal',
},
headerStyle: {
backgroundColor: '#b5259e',
},
}