Post

Replies

Boosts

Views

Activity

Reply to Navigation: update multiple times per frame
Same issue here when I try to include a .navigationDestination() modifier in my view. What I found out is that if we don't pass any variable(including a let, var or those wrapped in @State,@AppStorage,etc or passed through .environmentObject(some variable) ) to the destination view, it's perfectly fine. For example: .navigationDestination(Int.self){ Text("Hello World") } However if we do so, it will definitely cause an infinite loop, like the code below(where name is a property of our view): .navigationDestination(Int.self){ Text("Hello,\(name)") }
Jan ’23