title: SwiftUI doesn't update UI with ObservedObject in nested NavigationLink destination
body: <p>I currently have an app that's fetching data from an API, In the root view (let's call it Home) everything works as expected, in the second view (let's call it User View) everything works as expected but now on the third view (Team View) the <code>ObservedObject</code> for this view only is not working.</p>
  
  <p>The strangest part is that if the user navigates directly to the Team View, again every thing works as expected.</p>
  
  <p>Each view has it's own <code>ObservedObject</code> has the data being loaded belongs only to that view</p>
  
  <p>The navigation between each view is made by the <code>NavigationLink</code></p>
  
  <p>Heres an exemple of how I'm doing the loading and navigation.</p>
  
  <pre class="lang-swift prettyprint-override"><code>struct HomeView: View {
     @ObservedObject var viewModel = HomeViewModel()
     var body: some View {
         VStack {
             NavigationLink(destination: UserView(userId: viewModel.userId))
             NavigationLink(destination: TeamView(teamId: viewModel.teamId))
         }
     }
  }
  
  struct TeamView: View {
      @ObservedObject var viewModel = TeamViewModel()
      @State var teamId: String = ""
      var body: some View {
          Text(viewModel.name)
              .onAppear() { viewModel.loadData(id: teamId) }
      }
  }
  
  struct UserView: View {
      @ObservedObject var viewModel = UserViewModel()
      @State var userId: String = ""
      var body: some View {
          VStack {
              Text(viewModel.name)
              NavigationLink(destination: TeamView(teamId: viewModel.teamId))
          }
              .onAppear() { viewModel.loadData(id: userId) }
      }
  }
  </code></pre>
  
  <p>From the example you can see that the function to load the data is in the view model and is loaded when the view appears</p>
  
  <p>Everything works just fine but when I reach the 3rd level in the stack the data does not get updated in the view. I thought It might be the thread but I'm using <code>DispatchQueue.main.async</code> when the fetch is complete.</p>
  
  <p>All necessary variables on the Model are marked as <code>@Published</code></p>
  
  <p>In sum the following flows work</p>
  
  <pre><code>HomeView -&gt; TeamView
  HomeView -&gt; UserView
  </code></pre>
  
  <p>But this one on the last view it does load the data but it does not update the view</p>
  
  <pre><code>HomeView -&gt; UserView -&gt; TeamView
  </code></pre>