Navigation Destination not working

I got the error:

A NavigationLink is presenting a value of type “FormTemplate” but there is no matching navigationDestination declaration visible from the location of the link. The link cannot be activated.

This problem is only occurring on iPhone, on iPad works fine.

I was following the documentation, and can't find the error.

That's my base tabbar view:

TabView {
   ForEach(menuData, id: \.title) { item in
      NavigationStack {
         item.view
      }
      .tabItem {
         Text(item.title)
         Image(systemName: item.icon)
      }
      .tag(item.title)
   }
}

The menu view:

ScrollView {
   VStack (spacing: 12) {
      ForEach(lstMenu, id: \.title) { tV in
         NavigationLink(destination: tv.view, tag: tv.title, selection: $selection) {
            rowView
         }
      }
    }
    .navigationTitle("Segurança")
    .padding(.top, 20)
    .padding(.trailing, 20)
    .padding(.leading, 20)
}
.navigationTitle("Segurança")

The list view:

List {
    ForEach($viewModel. forms), id: \.documentId) { form in
        NavigationLink(value: form) {
            NameContentRow(entity: form)
                .frame(height: 75)
                .contentShape(Rectangle())
        }
    }
}
.navigationDestination(for: FormTemplate.self) { form in
    EventFormResponseList(form: form)
        .vlPermissions(permissions)
}
.refreshable {
    fetch(onPullToRefresh: true)
}
.listStyle(.insetGrouped)
.navigationBarTitleDisplayMode(.inline)
.navigationBarTitle("Formulários de eventos")
.padding(.horizontal, sizeClass == .compact ? 0 : 20)
.padding(.top, sizeClass == .compact ? 0 : 16)
.task {
    viewModel.loadFormTemplate(completion: { _ in })
}
Post not yet marked as solved Up vote post of bruno_mond Down vote post of bruno_mond
1.3k views