NavigationBackport
NavigationBackport copied to clipboard
'navigator.push' doesn't work in iOS 15 preview
struct ContentView: View {
@State var path = NBNavigationPath()
var body: some View {
NBNavigationStack {
HomeView()
}
}
}
struct HomeView: View {
@EnvironmentObject var navigator: PathNavigator
var body: some View {
VStack {
Button {
navigator.push(1)
} label: {
Text("Number 1")
}
}
.padding()
.nbNavigationDestination(for: Int.self) { number in
Text("number: \(number)")
}
}
}
struct PreferencesView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
In iOS 15 preview Tap the button, then go back, and then click the button again and there is no response.