Android, Jetpack Compose, Navigation, Type Safety, Kotlin.
ListOfBooksScreen( modifier = modifier, onBookClick = { navController.navigate(BookDetail(it.id)) }, ) } composable<BookDetail> { backStackEntry -> val bookDetail = backStackEntry.toRoute<BookDetail>() BookDetailScreen( modifier = modifier, bookId = bookDetail.id, ) } } } Key points: Notice the