Imagine you have this navigation system:
-TabNavigator
--TabA
---StackNavigatorA
----ScreenA
----StackNavigatorB
--TabB
---StackNavigatorB
----ScreenB
Is there any way, using React Navigation 5, to get the closest parent navigator name? For example, if I am in the screen "ScreenA" and execute the method I need, this will return "StackNavigatorA"
Something like this:
const currentNavigator = navigation.getCurrentNavigator(); // <--- getCurrentNavigator doesn't exist, this is pseudocode.
console.log(currentNavigator); // Will show the closest parent navigator
Thank you.