This implementation is a proof that I can't pop to a specific view using the isActive
property of the navigation link. I can easily push, pop and pop to the root. But I can't pop to a specific view.
I could not find anything to make the NavigationView work with a proper popToView behavior. Here's a discussion on the Apple Forums: https://developer.apple.com/forums/thread/134078.
- Abort popToView, support only popToRoot.
- Use multiple navigators to create multiple roots and instead of popToView, implement popToPinned, which pops to the last pinned route.
- It looks like there's a lib that does exactly what we need, it might be interesting to take a look: https://github.com/johnpatrickmorgan/FlowStacks