[Bug][Fabric] App freezes after several navigations when using getId on a Stack screen
Current behavior
My app is a news reader with two screens :
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen name="HomeScreen" component={HomeScreen} />
<Stack.Screen name="ArticleScreen" component={ArticleScreen} getId={({ params }) => params.url} />
</Stack.Navigator>
</NavigationContainer>
From the user perspective, when they navigate to an article, they expect a new screen to be pushed. That’s why I use getId to assign a unique identifier for each article.
Problem: after a few navigation actions with navigation.navigate("ArticleScreen", { url: "/my-url" }), the app freezes.
This didn’t happen with Paper — the issue started after migrating to Fabric.
I reproduced it on both iOS and Android, using Expo SDK 53 and 54 (not tested with SDK 52 or below).
https://github.com/user-attachments/assets/521b38ca-95e7-4a0f-8e21-579576ab5415
Expected behavior
The app doesn't freeze.
Reproduction
https://snack.expo.dev/@victorpe/bug---navigation-to-same-route-with-different-params-causes-freeze
Platform
- [x] Android
- [x] iOS
- [ ] Web
- [ ] Windows
- [ ] MacOS
Packages
- [ ] @react-navigation/bottom-tabs
- [ ] @react-navigation/drawer
- [ ] @react-navigation/material-top-tabs
- [x] @react-navigation/stack
- [x] @react-navigation/native-stack
- [ ] react-native-drawer-layout
- [ ] react-native-tab-view
Environment
- [] I've removed the packages that I don't use
| package | version |
|---|---|
| @react-navigation/native | 7.1.17 |
| @react-navigation/native-stack | 7.3.26 |
| react-native-screens | 4.16.0 |
| react-native-safe-area-context | 5.6.0 |
| react-native | 0.81.4 |
| expo | SDK 54 |
Couldn't find version numbers for the following packages in the issue:
-
@react-navigation/stack
Can you update the issue to include version numbers for those packages? The version numbers must match the format 1.2.3.
We don’t use @react-navigation/stack since we use @react-navigation/native-stack.
I've experienced similar issue after migration to
"react-native": "0.82.1",
"@react-navigation/bottom-tabs": "7.8.7",
"@react-navigation/material-top-tabs": "7.4.5",
"@react-navigation/native": "7.1.22",
"@react-navigation/native-stack": "7.8.1",
When I click bottom bar 3-5 times, it becomes frozen. It happens only in iOS = 26.
For now I've added a condition, seems to help until it's fixed somewhere. I don't even know if this issue comes from navigation library or one of it's dependencies. Anyway, disabling animation seems to help.
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
const Tab = createBottomTabNavigator()
......
<Tab.Navigator
screenOptions={{
animation: isIOSLiquidGlass() ? 'none' : 'shift',
Update: I tried reproducing this freeze with @react-navigation/material-top-tabs and couldn't.