NavigationBackport icon indicating copy to clipboard operation
NavigationBackport copied to clipboard

'navigator.push' doesn't work in iOS 15 preview

Open sugarwyc opened this issue 1 year ago • 2 comments

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.

sugarwyc avatar Nov 06 '23 01:11 sugarwyc