Update README.md

This commit is contained in:
Stephen Celis 2022-10-18 17:18:13 -07:00 committed by GitHub
parent 1276991597
commit a974c35e3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -166,10 +166,10 @@ struct ContentView {
var body: some View {
ForEach(self.posts) { post in
NavigationLink(unwrapping: self.$route, case: /Route.edit) { $post in
EditPostView(post: $post)
} onNavigate: { isActive in
NavigationLink(unwrapping: self.$route, case: /Route.edit) { isActive in
self.route = isActive ? .edit(post) : nil
} destination: { $post in
EditPostView(post: $post)
} label: {
Text(post.title)
}