*I’m using compose navigation in the app* I wanted to know, how do I navigate to a destination whic...
j
I’m using compose navigation in the app I wanted to know, how do I navigate to a destination which is not in my graph? ex: I have a feature F1 whose navigation graph is G1, from within one of the destinations of G1 I want to navigate to another graph G2 which is not part of G1 app/F1 G1 app/F2 G2
y
Just as you navigate to a classic destination
Copy code
@Composable
fun FirstNav() {
  val navController = rememberNavController()

  NavHost(
    navController = navController,
    startDestination = "route1",
    builder = {
       composable(...) {
         SecondNav()
       }
    }
  )
}

@Composable
fun SecondNav() {
  val navController = rememberNavController()

  NavHost(
    navController = navController,
    startDestination = "route2",
    builder = {
      ...
    }
  )
}
j
Lemme check