So we can get the destination before the current destination by using NavController.previousBackStackEntry, but I would like to get all the destinations that came before the current destination not just the one before in jetpack compose
You just need to iterate over the backQueue
property.
navController.backQueue.forEach { entry ->
Log.d("TAG", "${entry.destination.route}")
}