add an id to container, this is a workaround, I'll share a final solution once I get it
struct HomeLinearContent: View {
let ns: Namespace.ID
@ObservedObject var viewModel: HomeViewModel
let showLocation: Bool
@State private var refreshID = UUID()
var body: some View {
LazyVStack(spacing: 12) {
ForEach(viewModel.places, id: \.id) { place in
NavigationLink(value: place) {
HomeCardHorizontalView(place: place, ns: ns, showLocation: showLocation)
}
.buttonStyle(.plain)
}
}.id(refreshID)
.navigationDestination(for: Place.self) { place in
PlaceDetailView(place: place)
.navigationTransition(.zoom(sourceID: place, in: ns))
.onDisappear {
refreshID = UUID()
}
}
.padding(.top, 12)
.background(Color.black)
}
}
Topic:
UI Frameworks
SubTopic:
SwiftUI