@olonsky Thanks for the example. I think the root cause is that in our code bases the navigation is changed in two different runloops, giving SwiftUI conflicting information about the desired navigation state. The fix is to make sure that the navigation for all views is derived from a single value (nested enum or an array) that is changed in a single step.
btw: I don't understand why you need to defer changing the path using DispatchQueue.main.async. By removing this hack, the crash is gone.
.onReceive(coordinator.$path) { value in
// DispatchQueue.main.async {
path = value
// }
}
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: