Skip to content

Why immediately dismiss when Tree Based navigation with navigationDestination(item: destination:) #3264

Answered by mbrandonw
MaraMincho asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @MaraMincho, you have nested NavigationStacks in this code sample, and that is not a valid thing to do, even in vanilla SwiftUI.

For example, The RootNavigationView has a stack at its root, and then it can navigate to ChildNavigationView, which also has a stack. You will need to refactor this so that there is only one single NavigationStack.

Further, the navigationDestination(item:) API in SwiftUI is quite buggy when it comes to multiple levels of navigation. You typically cannot deep link more than 1 level.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@MaraMincho
Comment options

Answer selected by MaraMincho
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants