Good day! It seems to be a bug in Xcode that preview can be showed correctly with async code wrapped in Task, for ex:
struct MyView: View {
var onTapped: (() async -> Bool)?
var body: some View {
Button {
Task {
guard await onTapped?() ?? true else { return }
}
.....
} label: {
Text("Tap me")
}
}
}
Crash log