DEV Community

Discussion on: Combining Stack, Tab & Drawer Navigations in React Native With React Navigation 5

Collapse
 
easybuoy profile image
Ekunola Ezekiel

So I'm guessing the way your navigation is set up is that your Tab navigation is calling the Stack navigation, and the Tab navigation is being used in the App.js entry point to the app right?

Collapse
 
gauravmahendru profile image
Gaurav Mahendru

Actually, Tab Navigation (I am using this inside return function of a HomeScreen) should be called on a button but it’s not working.

For the App.js, right now I have made SignInScreen as my entry point which comes from AppTextInput file and this AppTextInput.js file has a button to call Tab Navigation, but unluckily, I am getting an error of undefined navigation.navigate even though I am using the navigation props with the function.

Thread Thread
 
easybuoy profile image
Ekunola Ezekiel

I think the issue is you need to return a navigation (tab navigation which contains the stack screens) in the app.js file, just like it's shown in this article. You can set the default screen to show up on the first app load.

Thread Thread
 
gauravmahendru profile image
Gaurav Mahendru

My default screen is SignInScreen and this screen has a button to it. On a click of this, I want to go to Tab Navigation which I created.

It's giving me navigation error even though I am using navigation as a props with the SignInScreen return function. Normally, I have tested my Tab Navigation by straight calling it into App.js. This works but I want this to be called on Button. It's not working for me.