iOS 17 Beta 8: NavigationStack in NavigationSplitView doesn't render navigation destination if the initial navigation path contains an element

Well the title says it all. Here is a minimal reproducible example of the issue:

import SwiftUI

enum NavigationDestination {
  case secondPage
}

@main
struct iOS17NavigationSplitViewApp: App {
  @State var navigationPath: [NavigationDestination] = [.secondPage]

  var body: some Scene {
    WindowGroup {
      VStack {
        NavigationSplitView(
          columnVisibility: .constant(.all),
          sidebar: {
            Text("Sidebar")
            Button("SecondPage") {
              navigationPath.append(.secondPage)
            }
          },
          detail: {
            NavigationStack(path: $navigationPath) {
              VStack {}
                .navigationDestination(for: NavigationDestination.self) { destination in
                  let _ = print("@navigationDestination. destination:", destination)
                  switch destination {
                  case .secondPage:
                    Text("SecondPage")
                      .onAppear {
                        print("@SecondPage onAppear")
                      }
                      .navigationBarBackButtonHidden()
                  }
                }
            }
          }
        )
      }
    }
  }
}

If this app is run on iOS 16 iPhone the text "SecondPage" is rendered. On iOS 17 beta 8 iPhone the string "@SecondPage onAppear" is printed but only a blank screen is rendered.

This will work on iOS 17 if the initial value of navigationPath is an empty array or if the NavigationSplitView is removed from the view, but in my app, I want to navigate directly to the second page and prevent the user to access the sidebar on iPhone.

I submitted a bug report to Apple but does anyone know a good workaround for this?

iOS 17 Beta 8: NavigationStack in NavigationSplitView doesn't render navigation destination if the initial navigation path contains an element
 
 
Q