https://kotlinlang.org logo
#compose
Title
# compose
u

0xf1f1

02/26/2024, 7:34 PM
how does one pass viewmodels w/ DI to nested screens ?
h

Harold Martin

02/26/2024, 7:40 PM
You could but this is bad practice! Prefer instead to pass in the details needed by the children from the composable that has the VM
👆 1
u

0xf1f1

02/26/2024, 9:44 PM
but what if the children use a different viewmodel ? i am using nabgraph if that helps
Koin has integration with androidx.navigation too if you prefer that