Skip to content

Commit 4e17116

Browse files
authored
Changed the onChange callback to onReceive as the later best works with @published publisher cause it guarantees response to a value change independent of SwiftUI's rendering pipeline (#19)
1 parent fbd7d25 commit 4e17116

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

AppUIComponents/LoginOptions/LoginOptionsView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ struct LoginOptionsView: View {
8585
showAlert = true
8686
}
8787
}
88-
.onChange(of: viewModel.navigationRoute) { _ in
89-
guard let route = viewModel.navigationRoute else { return }
88+
.onReceive(viewModel.$navigationRoute) { route in
89+
guard let route = route else { return }
9090
router.navigate(to: route)
9191
}
9292
}

0 commit comments

Comments
 (0)