[iOS] With 5 bottom tabs, the last bottom tab always pops the stack to top on focus with react-navigation
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 48/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Tranquilo
- Stack tecnológico
- ios, react-native, typescript
- Área
- mobile
Línea de trabajo
Comienza con la reproducción proporcionada usando createNativeBottomTabNavigator, un navegador de cinco pestañas y un stack nativo en la pestaña final; ejecútala en iOS y compara el comportamiento con menos pestañas. Rastrea el foco de la pestaña y la restauración del stack alrededor de la pestaña final, y luego verifica que al volver a ella se conserve la pantalla Details sin volver al root.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Before submitting a new issue
- I tested using the latest version of the library, as the bug might be already fixed.
- I tested using a supported version of react native.
- I checked for possible duplicate issues, with possible answers.
Bug summary
On iOS when having 5 bottom tabs, the last bottom tab always pops the native stack to top when used with react-navigation. This does not occur when using less than 5 tabs. Adding popToTopOnFocus={false} to the options does not help. Happens on the latest library version, but also happened on versions 0.4.x. I'm using Expo SDK 54, react-native 0.81.5. @react-navigation/native 7.1.18.
Library version
1.0.2
Environment info
System:
OS: macOS 15.6.1
CPU: (14) arm64 Apple M4 Pro
Memory: 8.34 GB / 48.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 22.14.0
path: /Users/xxx/.nvm/versions/node/v22.14.0/bin/node
Yarn: Not Found
npm:
version: 10.9.2
path: /Users/xxx/.nvm/versions/node/v22.14.0/bin/npm
Watchman:
version: 2025.09.15.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods: Not Found
SDKs:
iOS SDK:
Platforms:
- DriverKit 25.0
- iOS 26.0
- macOS 26.0
- tvOS 26.0
- visionOS 26.0
- watchOS 26.0
Android SDK: Not Found
IDEs:
Android Studio: 2025.1 AI-251.27812.49.2514.14217341
Xcode:
version: 26.0.1/17A400
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.16
path: /usr/bin/javac
Ruby:
version: 2.6.10
path: /usr/bin/ruby
npmPackages:
"@react-native-community/cli":
installed: 20.0.2
wanted: latest
react:
installed: 19.1.0
wanted: 19.1.0
react-native:
installed: 0.81.5
wanted: 0.81.5
react-native-macos: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: Not found
newArchEnabled: Not found
iOS:
hermesEnabled: Not found
newArchEnabled: Not found
Steps to reproduce
- Create a bottom tab navigator with 5 tabs.
- Make the 5th (last) tab render a native stack with two screens.
- Navigate in the last tab from its root to a second screen.
- Switch to any other tab, then switch back to the last tab
Seems to occur on iOS only
Reproducible sample code
import * as React from 'react';
import { Button, Text, View } from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { createNativeBottomTabNavigator } from '@bottom-tabs/react-navigation';
const Stack = createNativeStackNavigator();
const Tabs = createNativeBottomTabNavigator();
function Screen({ label }: { label: string }) {
return (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<Text>{label}</Text>
</View>
);
}
function MenuHome({ navigation }: any) {
return (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<Text>Menu Home</Text>
<Button title="Go to Details" onPress={() => navigation.push('Details')} />
</View>
);
}
function Details() {
return (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<Text>Details</Text>
</View>
);
}
function MenuStack() {
return (
<Stack.Navigator>
<Stack.Screen name="MenuHome" component={MenuHome} options={{ title: 'Menu' }} />
<Stack.Screen name="Details" component={Details} />
</Stack.Navigator>
);
}
function RootTabs() {
return (
<Tabs.Navigator initialRouteName="Home">
<Tabs.Screen name="Home" children={() => <Screen label="Home" />} />
<Tabs.Screen name="Markets" children={() => <Screen label="Markets" />} />
<Tabs.Screen name="Options" children={() => <Screen label="Options" />} />
<Tabs.Screen name="Blocks" children={() => <Screen label="Blocks" />} />
{/* IMPORTANT: Last tab renders a native stack */}
<Tabs.Screen name="Menu" component={MenuStack} />
</Tabs.Navigator>
);
}
export default function App() {
return (
<NavigationContainer>
<RootTabs />
</NavigationContainer>
);
}
- Lenguaje dominante
- TypeScript
- Estrellas
- 1.5k
- Forks
- 108
- Merge medio
- 12 h 42 min
- PR fusionados (30 d)
- 9
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de callstack/react-native-bottom-tabs
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 68/100
callstack/react-native-bottom-tabs#591 · 1 comentario ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 58/100
Todos los issues de callstack/react-native-bottom-tabs
Issues similares
-
VerificationGate: ATTRIBUTION quote guard never matches a normal quotation (\b around the quote) Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
danielmiessler/LifeOS#2234 ·
-
T: Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
-
Mend: dependency security vulnerability untriaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100