can I not take these `composable` functions out in...
# compose
o
can I not take these
composable
functions out into their own files in some way?
Copy code
NavHost(
        modifier = modifier,
        navController = navController,
        startDestination = BottomRoute.Books.path
    ) {

        // these things
        composable(BottomRoute.Books.path) {
            BooksScreen(
                modifier = Modifier
                    .fillMaxSize(),
                scaffoldState = scaffoldState,
                navigateAddBook = { navController.navigate(Route.AddBook.path) },
                navigateBookDetail = { navController.navigateBookDetail(it.book_id) },
            )
        }
they can't exist unless inside a NavHost
i
That's actually exactly what the documentation recommends you do: https://developer.android.com/guide/navigation/design/type-safety
☝🏻 1
The key point is that they need to be extensions on the
NavGraphBuilder
- everything in that lambda is the navigation graph Kotlin DSL
o
ahh thanks!