error appears when i try to put navigation link inside button code
Button("back") {
NavigationLink(destination: ContentView())
}
^
The NavigationLink needs also a title or label as an argument. Also, you don't need to put a navigation link in a button because it's already a button. This code would be correct:
NavigationLink("Back") {
ContentView()
}
Or this:
NavigationLink {
ContentView()
} label: {
Text("Back")
}
I hope it helps