-
Hi, FirstFeature action case .destination(.presented(.second(.delegate(.thirdRequested)))):
state.destination = .third(.init())
return .none FirstView NavigationStack {
ZStack {
Color.green
WithViewStore(self.store, observe: { $0 }) { viewStore in
VStack {
Text("FirstView")
Button.init {
viewStore.send(.showSecond)
} label: {
Text("To second view")
}
}
}
}
.navigationDestination(
store: self.store.scope(state: \.$destination, action: { .destination($0) }),
state: /FirstFeature.Destination.State.second,
action: FirstFeature.Destination.Action.second,
destination: SecondView.init(store:)
)
.navigationDestination(
store: self.store.scope(state: \.$destination, action: { .destination($0) }),
state: /FirstFeature.Destination.State.third,
action: FirstFeature.Destination.Action.third,
destination: ThirdView.init(store:)
)
} video.mp4 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
Hi @alinless, based on your little code snippet I think the app is actually behaving correctly. The problem is that when you mutate the Or, if you really do want to coalesce all destinations at the root of the navigation view, then unfortunately you do need to use |
Beta Was this translation helpful? Give feedback.
Hi @alinless, I just checked in vanilla SwiftUI and apparently that is the behavior there too. I thought for some reason it would animate but that is not the case.
Here's a sample for you to test: