title: SwiftUI: NavigationLink weird behaviour
body: <p>I'm trying to build a store in order to navigate in a SwifUI flow.
  The idea is that every screen should observe the state and push into the next one using a NavigationLink.</p>
  <p>It seems to work for pushing one view, but a soon as I push several views into the stack, it starts behaving oddly: the view pops itself.</p>
  <p>Luckily I was able to reproduce it in a separate project. When I move from 2 to 3, the third screen appears but the NavigationView resets to it's original state (<code>ContentView</code>):</p>
  <pre><code>import SwiftUI
  
  @main
  struct NavigationTestApp: App {
      
      var body: some Scene {
          WindowGroup {
              NavigationView {
                  ContentView()
              }.navigationViewStyle(StackNavigationViewStyle())
          }
      }
  }
  
  
  
  class Store: ObservableObject{
      @Published var state: StoreState
      
      struct StoreState {
          var flowState: FlowState = .none
      }
      
      enum FlowState {
          case none, one, two, three
      }
      
      enum Action {
          case moveTo1, moveTo2, moveTo3
      }
      
      init(state: StoreState) {
          self.state = state
      }
      
      func send(_ action: Action) {
          
          switch action {
          case .moveTo1:
              state.flowState = .one
          case .moveTo2:
              state.flowState = .two
          case .moveTo3:
              state.flowState = .three
          }
      }
      
      
  }
  
  struct ContentView: View {
      
      @ObservedObject var store = Store(state: .init())
      
      
      var body: some View {
          VStack {
              Button(action: {
                  store.send(.moveTo1)
              }, label: {
                  Text(&quot;moveTo1&quot;)
              })
              NavigationLink(
                  destination: ContentView1().environmentObject(store),
                  isActive: Binding(
                      get: { store.state.flowState == .one },
                      set: { _ in
                      }
                  ),
                  label: {}
              )
          }
          
      }
  }
  
  struct ContentView1: View {
      @EnvironmentObject var store: Store
      
      var body: some View {
          VStack {
              Button(action: {
                  store.send(.moveTo2)
              }, label: {
                  Text(&quot;moveTo2&quot;)
              })
              
              NavigationLink(
                  destination: ContentView2().environmentObject(store),
                  isActive: Binding(
                      get: { store.state.flowState == .two },
                      set: { _ in
                      }
                  ),
                  label: {}
              )
          }
      }
  }
  
  struct ContentView2: View {
      @EnvironmentObject var store: Store
      
      var body: some View {
          VStack {
              Button(action: {
                  store.send(.moveTo3)
              }, label: {
                  Text(&quot;moveTo3&quot;)
              })
              
              NavigationLink(
                  destination: ContentView3().environmentObject(store),
                  isActive: Binding(
                      get: { store.state.flowState == .three },
                      set: { _ in
                      }
                  ),
                  label: {}
              )
          }
      }
  }
  
  struct ContentView3: View {
      @EnvironmentObject var store: Store
      
      var body: some View {
          
          Text(&quot;Hello, world!&quot;)
              .padding()
      }
  }
  
  </code></pre>
  <p>What am I missing?</p>