Android, Jetpack Compose, Navigation, Type Safety, Kotlin.
retrieve the navigation arguments: @HiltViewModel class BookDetailViewModel @Inject constructor( savedStateHandle: SavedStateHandle, ) : ViewModel() { private val _book = MutableStateFlow(savedStateHandle.toRoute<BookDetail>().book) val book = _book.asStateFlow() } That way we can remove the