79169790

Date: 2024-11-08 11:19:42
Score: 0.5
Natty:
Report link

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

Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Vishal Bhimporwala