i have a tab navigator that has two screens, the first one its just a screen component, and the second one its a stack navigator that has two screens, so when i swipe i get to the first screen of the stack navigator, the problem now is that when i swipe back to the first screen, i need to know if the current focus screen is the first of the tab or the first of the stack, using navigation im only getting the screens of the stack navigator and not from the tab navigator, is there a way i can know it?
heres the code, this is the tab navigator:
return (
<>
<Tab.Navigator
tabBar = {() => null}
tabBarPosition = "bottom"
sceneContainerStyle = {{style: {marginTop: StatusBar.currentHeight}}}
screenOptions = {{
swipeEnabled: swipe,
//unmountOnBlur: true
}}
>
<Tab.Screen name = "VisionList" component = {VisionListScreen}/>
<Tab.Screen name = "Sound" component = {Routes} screenOptions = {{gestureEnabled: false}}/>
</Tab.Navigator>
{
(show && song) ?
<BottomSheet show = {show} info = {song}></BottomSheet> : null
}
</>
)
and heres the stack navigator, that is the Routes component in the tab navigator:
<Stack.Navigator theme = {MyTheme} screenOptions={{headerShown: false, transparentCard:true}}>
<Stack.Screen
options = {() => ({
gestureEnabled: false,
transitionSpec: {
open: {
animation: "timing", config: {duration: 1100}
},
close: {
animation: "timing", config: {duration: 1000}
}
},
cardStyleInterpolator: ({current: {progress}}) => {
return {
cardStyle: {
opacity: progress,
}
}
}
})}
name = "HomeDrawer"
component = {Home}
>
</Stack.Screen>
<Stack.Screen
options = {() => ({
gestureEnabled: false,
transitionSpec: {
open: {
animation: "timing", config: {duration: 1100}
},
close: {
animation: "timing", config: {duration: 1000}
}
},
cardStyleInterpolator: ({current: {progress}}) => {
return {
cardStyle: {
opacity: progress,
}
}
}
})}
name = "ArtistSection"
component = {ArtistSection}
>
</Stack.Screen>
</Stack.Navigator>
when i blur in the HomeDrawer screen i need to know if im in the VisionList of the tab navigator, but i cant, thanks :)