In StackScreenΑ if get route name I will take StackScreenΒ1 or StackScreenΒ2 depending on which page I’m on.
The same in StackScreenB1 if get route name I will take ScreenC1 or ScreenC2 or ScreenC3 depending on which page I’m on.
Is there any way when I am on StackScreenΑ to get route name on Nested Screens of StackScreenB1.
Explain. I am on stage A and I want to get the route name of stage C and not B.
*For get route name of B when I am on A , alert(route.name)
2
Answers
I had struggle with the nav as well. I made this post, and finally understood how to nest different navigations:
https://stackoverflow.com/a/72834227/8119333
In this, I made a stack nav into a bottom tab nav. I think you can do exactly de same with 2 stack nav and navigate from anywhere to anywhere.
so when you declare your route a the very top of you app:
Your route names are
screenA
,screenB
andscreenC
I had the same problem and was able to make it work using the following code.
AppContext.js
App.js
YourFile.js