trying out the navigation library I'm passing the ...
# compose
t
trying out the navigation library I'm passing the NavController to most of my screens, but this seems to break
@Preview
feature, is. there something I could pass into a composable with preview as a NavController?
l
The stateless Composable could instead accept a function, for example
onNavigate: (String) -> Unit
f
You can just add a default value @Composable @Preview fun MyScreen(navController:NavController = rememberNavController){}
i
We specifically talk about avoiding passing the NavController down directly in the Testing part of the docs: https://developer.android.com/jetpack/compose/navigation#testing
K 1