While using TCA I am facing this issue for the first time ever:
if I use a NavigationLink isActive
with vanilla SwiftUI @State it works just fine
NavigationLink(
destination: MapDetailView(store: self.store),
isActive: $showDetailView
) {
Button {
showDetailView = true
} label: {
Text("SHOW DETAIL")
}
}
but if I use the TCA way of handling the binding it won't work, although I have used the same approach multiple times and it works just fine but not in this case.
NavigationLink(
destination: MapDetailView(store: self.store),
isActive: viewStore.binding(
get: { $0.route == .showDetailView(true) },
send: MapsFeature.Action.setDetailView(isPresented:)
)
) {
Button {
viewStore.send(.setDetailView(isPresented: true))
} label: {
Text("SHOW DETAIL")
}
}