Is it possible to mix fragment and composable destination in a
NavHost
? I want to add a fragment that I don’t own, from a library, as a destination. I tried:
NavHost(
navController = navController,
startDestination = route,
) {
composable(...) { ... )
fragment<LibraryFragment>(id)
}
But when I run, the activity crashes with
Could not find Navigator with name "fragment". You must call NavController.addNavigator() for each navigation type.
If it’s not possible, is there another way to add a fragment to composition?