title: Why does onAppear() execute twice when placed on elements inside a NavigationView in swiftUI? (Xcode 12.0)
body: <p><code>FirstView Appeared</code> is printed twice. Once when the view first loads and again when the NavigationLink is selected.</p>
  <pre><code>import SwiftUI
  
  struct FirstView: View {
      
      var body: some View {
          NavigationView{
              ZStack{
                  Text(&quot;FirstView&quot;).onAppear(perform: {print(&quot;FirstView Appeared&quot;)})
                  
                  NavigationLink(destination: SecondView()) {
                      Text(&quot;Goto SecondView&quot;)
                  }.offset(y: 50)
              }
          }
      }
  }
  
  struct SecondView: View {
      
      var body: some View {
  
          Text(&quot;SecondView&quot;).onAppear(perform: {print(&quot;SecondView Appeared&quot;)})
      }
  }
  </code></pre>
  <p>Running the code above in Xcode 12.0 beta on both the simulator and a personal device produce the output below when the NavigationLink is selected:</p>
  <pre><code>FirstView Appeared
  FirstView Appeared
  SecondView Appeared
  </code></pre>
  <p>Is this duplication of onAppear() expected behavior?</p>
  <p>If so, what best practices are there to load some data when <code>firstview</code> is created and then upon return to <code>firstview</code> (since onAppear() would attempt to load some data when navigating away from <code>firstView</code>)</p>