Reputation: 407
I recently updated my react-native app and I am experiencing this error. I fail to understand what's wrong with the code.
import { createAppContainer } from 'react-navigation';
import {
createDrawerNavigator,
createStackNavigator,
createSwitchNavigator,
} from 'react-navigation-stack';
// app stack
const appNavigator = createSwitchNavigator(
{
splashScreen: {
screen: SplashScreen,
},
public: {
screen: publicRoutes,
},
private: {
screen: createDrawerNavigator(
{
home: privateRoutes,
},
{
contentComponent: DrawerMenu,
overlayColor: colors.overlayColor,
},
),
},
tnc: {
screen: TermsAndConditions,
},
},
{
headerMode: 'none',
navigationOptions: {
gesturesEnabled: false,
},
},
);
What am I doing wrong here? Thanks in advance for your help.
Upvotes: 1
Views: 1385
Reputation: 38
You are trying to import createDrawerNavigator from 'react-navigation-stack'. You should do this instead:
import { createDrawerNavigator } from '@react-navigation/drawer';
Read more about drawer navigator here: https://reactnavigation.org/docs/drawer-navigator/
Upvotes: 2