.navigationDestination(isPresented) hangs after reboot (when called within 2 minutes of reboot) in watchOS when destination view contains @Environment(.dismiss).
Feedback: FB21077151
Second button hangs after reboot. Hangs in watchOS 26.0 and 26.4 on a physical device.
struct ContentView: View {
@State var presentView1 : Bool = false
@State var presentView2 : Bool = false
var body: some View {
NavigationStack {
VStack {
Button("Show View 1") {
presentView1.toggle()
}
Button("Show View 2") {
presentView2.toggle()
}
}
.navigationDestination(isPresented: $presentView1, destination: {TestView1()})
.navigationDestination(isPresented: $presentView2, destination: {TestView2()})
}
}
}
struct TestView1: View {
var body: some View {
Text("View 1")
}
}
struct TestView2: View {
@Environment(\.dismiss) var dismiss
var body: some View {
Text("View 2")
}
}