Skip to content

Instantly share code, notes, and snippets.

@LachlanMcKee
Created June 3, 2021 10:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LachlanMcKee/58e58858d8070b2e2045ea9bbbef1a72 to your computer and use it in GitHub Desktop.
Save LachlanMcKee/58e58858d8070b2e2045ea9bbbef1a72 to your computer and use it in GitHub Desktop.
Scalable Jetpack Compose Navigation - With Library - JetpackNavigationHiltApp
// Potentially defined within the app module
@Composable
fun JetpackNavigationHiltApp() {
val navController = rememberNavController()
val context = LocalContext.current
// The start destination would still need to be known at this point.
NavHost(navController, startDestination = "feature1") {
hiltNavGraphNavigationFactories(context).addNavigation(this, navController)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment