Hi all, i try to implement a bottomNavigation with...
# compose-destinations
m
Hi all, i try to implement a bottomNavigation with 3 NavGraphSpec (1 for each tab) but when i click on a button i have this error: navigation destination pois/map_screen is not a direct child of this NavGraph (MapScreen is the startRoute of my PoiNavGraph) This is my HomeNavGraph (which is for the bottomNavigation:
Copy code
object HomeNavGraphs {
    val home = object : NavGraphSpec {
        override val route = "home"

        override val startRoute = PoiNavGraphs.pois.startRoute routedIn this

        override val nestedNavGraphs = listOf(ExpenseNavGraphs.expenses, PoiNavGraphs.pois, ProfileNavGraphs.profile)

        override val destinationsByRoute = mutableListOf<DestinationSpec<*>>().apply {
            addAll(NavGraphs.root.destinations)
        }.toList().routedIn(this).associateBy { it.route }
    }
}
r
Drop all the “routed in” calls. As you can read in its documentation, that will change the route you are registering these in, so if you do that, then you’d have to also specify the graph when navigating. Unless you know what you’re doing, don’t use routed in. In fact this API will disappear with v2
Then let me know if it fixes it 🙂