That worked! Not sure what I was doing wrong.
List {
VStack (alignment: .leading, spacing: 24) {
HeaderView()
Picker("Filter", selection: $selectedFilter) {
Text("One").tag("One")
Text("Two").tag("Two")
}
.pickerStyle(.segmented)
}
.listRowSeparator(.hidden)
if selectedFilter == "One" {
ForEach(0..<10) { index in
NavigationLink(destination: DetailView()) {
RowView()
}
}
}
}
.listStyle(.plain)
Selecting any option will automatically load the page