t

    Tijs Gobbens

    1 year ago
    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?
    lewis

    lewis

    1 year ago
    The stateless Composable could instead accept a function, for example
    onNavigate: (String) -> Unit
    FunkyMuse

    FunkyMuse

    1 year ago
    You can just add a default value @Composable @Preview fun MyScreen(navController:NavController = rememberNavController){}
    i

    Ian Lake

    1 year ago
    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