fix: tab press listeners reset stack to index - fixes stale detail screen from cross-tab navigation
This commit is contained in:
@@ -29,7 +29,10 @@ export default function AppLayout() {
|
|||||||
/>
|
/>
|
||||||
<Tabs.Screen
|
<Tabs.Screen
|
||||||
name="clients"
|
name="clients"
|
||||||
options={{ title: 'Clients', tabBarIcon: ({ color }) => <Icon name="users" size={22} color={color} />, unmountOnBlur: true }}
|
options={{ title: 'Clients', tabBarIcon: ({ color }) => <Icon name="users" size={22} color={color} /> }}
|
||||||
|
listeners={({ navigation }: any) => ({
|
||||||
|
tabPress: () => { navigation.navigate('clients', { screen: 'index' }); },
|
||||||
|
})}
|
||||||
/>
|
/>
|
||||||
<Tabs.Screen
|
<Tabs.Screen
|
||||||
name="payments"
|
name="payments"
|
||||||
@@ -37,7 +40,10 @@ export default function AppLayout() {
|
|||||||
/>
|
/>
|
||||||
<Tabs.Screen
|
<Tabs.Screen
|
||||||
name="tasks"
|
name="tasks"
|
||||||
options={{ title: 'Tickets', tabBarIcon: ({ color }) => <Icon name="ticket" size={22} color={color} />, unmountOnBlur: true }}
|
options={{ title: 'Tickets', tabBarIcon: ({ color }) => <Icon name="ticket" size={22} color={color} /> }}
|
||||||
|
listeners={({ navigation }: any) => ({
|
||||||
|
tabPress: () => { navigation.navigate('tasks', { screen: 'index' }); },
|
||||||
|
})}
|
||||||
/>
|
/>
|
||||||
<Tabs.Screen
|
<Tabs.Screen
|
||||||
name="profile"
|
name="profile"
|
||||||
|
|||||||
Reference in New Issue
Block a user