Thanks to the Decompose library owner for providing a quick response and saving my time. Here’s the code for the Android entry point to create two retainedComponent.
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val (rootComponent, dashBoardRootComponent) = retainedComponent {
RootComponent(it.childContext("root")) to DashBoardRootComponent(it.childContext("dash"))
}
setContent {
App(rootComponent, dashBoardRootComponent)
}
}
}
Here link for original answer by owner. Solution