Running into a limitation of decompose or an issue with decompose-router implementation.
I have the following screen hierarchy
@Parcelize
sealed class Screen : Parcelable {
data object A : Screen()
data object B : Screen()
data object C : Screen()
}
These are shown with RoutedContent on a screen like this
@Composable fun Screen(){
val router: Router<Screen> = rememberRouter(Screen::class, stack = listOf(A))
RoutedContent(router = router) { screen ->
when (screen) {
A -> AScreen()
B -> BScreen()
C -> CScreen()
}
}
This works fine. However, whenever one or more of the screens contain a nested router like this
@Parcelize
sealed class NestedScreen : Parcelable {
data object BA : Screen()
data object BB : Screen()
data object BC : Screen()
}
@Composable fun BScreen(){
val nestedRouter: Router<MainScreens> = rememberRouter(NestedScreen::class, stack = listOf(NestedScreen.BA))
..
}
Upon returning from C ā B, it throws
java.lang.IllegalStateException: Another supplier is already registered with the key: Screen.B.router
Running into a limitation of decompose or an issue with decompose-router implementation.
I have the following screen hierarchy
These are shown with
RoutedContent
on a screen like thisThis works fine. However, whenever one or more of the screens contain a nested router like this
Upon returning from C ā B, it throws