Does anyone know how fake/pass navController to ma...
# compose
a
Does anyone know how fake/pass navController to make a preview for BottomNavigation?
k
The alternative is to factor out the composable to accept simple values and lambdas
Copy code
@Composable fun BottomNavigation(navController: NavController) {
    val currentDestination by navController.observeDestinationAsState()
    BottomNavigation(currentDestination, navController::navigate)
}

@Composable fun BottomNavigation(destination: String, navigate: (String) -> Unit) { ... }
and you can use the second composable for previews
👍 1
i