So basically, if I put a .navigationModifier inside of a NavigationStack that's inside of a TabView, AND I supply a path argument to NavigationStack. I get this error:
Do not put a navigation destination modifier inside a "lazy” container, like `List` or `LazyVStack`. These containers create child views only when needed to render on screen. Add the navigation destination modifier outside these containers so that the navigation stack can always see the destination. There's a misplaced `navigationDestination(for:destination:)` modifier for type `NavPath`. It will be ignored in a future release.
Does TabView or NavigationStack suddenly become lazy when I put the path parameter in? It also causes weird unexplained behavior if I start removing tabs using state, but I do think I'm not supposed to do that.
Code for reference:
var body: some View {
@Bindable var nm = navManager
TabView{
NavigationStack(path: $nm.pathStack){
HomeView() // A custom view
.navigationDestination(for: NavPath.self) { np in // NavPath is a custom struct that's hashable
switch np.pathId {
case "home":
NavigationLazyView(HomeView()) // Ignore the NavigationLazyView, does not affect
...