-
Notifications
You must be signed in to change notification settings - Fork 75
Description
Title
Deep back navigation causes infinite loop when using NavigationStack instead of NavigationView
Description
When replacing NavigationView with NavigationStack in a TabView setup with FlowStacks coordinators, deep back navigation triggers an infinite loop, making it impossible to navigate back through the stack.
Repository Link
Full code available at: FlowStacks_Back_Bug_Navigation
- Relevant file:
LiquidGlass%2BFlowsStack/Root/TabBarView.swift
Current Code
TabView {
ForEach(viewModel.tabs, id: \.id) { coordinator in
Tab(coordinator.tabBarItem.name, systemImage: coordinator.tabBarItem.systemImage) {
NavigationView { // Works fine
TabResolverView(coordinator: coordinator)
}
}
}
}
Problematic Code
TabView {
ForEach(viewModel.tabs, id: \.id) { coordinator in
Tab(coordinator.tabBarItem.name, systemImage: coordinator.tabBarItem.systemImage) {
NavigationStack { // Causes infinite loop on deep back navigation
TabResolverView(coordinator: coordinator)
}
}
}
}
Expected Behavior
Deep back navigation should work the same way with NavigationStack as it does with NavigationView, allowing users to navigate back through multiple screens without getting stuck.
Actual Behavior
When attempting to navigate back through multiple screens (deep back navigation), the app gets stuck in an infinite loop and becomes unresponsive.
Environment
- iOS: 26.0 (23A5297i)
- Xcode: 26.0 beta 4 (17A5285i)
- FlowStacks version: 0.8.4
Reproduction Steps
- Set up TabView with NavigationStack containing FlowStacks coordinator
- Navigate deep into a flow (multiple screens)
- Attempt to navigate back multiple levels
- App gets stuck in an infinite loop
This issue prevents migration from the deprecated NavigationView to the modern NavigationStack API.