This is my navigation codes, I've got a drawer navigator, that contains stacks within, the problem I am having is that I can't use this.props.navigation.openDrawer() within the stack, navigators to open the drawer but I still can open the drawer by swiping on the screen. my code,
const MyDrawerNavigator = createDrawerNavigator(
{
Home: AppStack,
MyAccount: MyAccountStack,
PointsProfile: PointsProfStack,
WishList: WishListStack,
BonusPoint: BonusPoint,
ContactUs: ContactUs,
InviteFriend: InviteFriend,
Terms: Terms,
SignOut: SignOut
}
}
const AppStack = createStackNavigator(
{
Home: Home,
Notification: Notification,
Suggested: Suggested,
HomeSearch: HomeSearchV2,
SearchHist: DishSearchHistory,
//tab screens
MealScreen: MealScreenTab,
SearchScreen: SearchScreenTab,
CuisineScreen: CuisineScreenTab
})
when I console logged this.props.navigation within the AppStack I found out that the openDrawer() function is not provided.
But when I console logged this.props.navigation within ContactUs which is just a screen, It shows openDrawer() function.
Is the way I am writing my navigation wrong, any help would be appreciated.
Thanks in advance.