title: Can a NavigationLink perform an async function when navigating to another view?
body: <p>I'm trying to create a navigation link in SwiftUI that logs in a user and navigates to the next screen.</p>
  <p>I've tried using .simultaneousGesture as shown below, based on <a href="https://stackoverflow.com/questions/57666620/is-it-possible-for-a-navigationlink-to-perform-an-action-in-addition-to-navigati">this solution</a>. When I have it perform a simple action (e.g. print(&quot;hello&quot;)), the code works fine and navigates to the next page, but when I have it perform my authState.signUp function (which is async), it calls the function but doesn't navigate to the next page.</p>
  <p>Is there a different way I should be approaching this?</p>
  <pre><code>NavigationLink(destination: NextView()) {
      Text(&quot;Create account&quot;)
  }
  .simultaneousGesture(TapGesture().onEnded {
      authState.signUp(user: user)
  })
  </code></pre>