Thread
#compose
    Vsevolod Kaganovych

    Vsevolod Kaganovych

    1 year ago
    Do we have a way to inject parameters from arguments inside viewmodel from compose navigation with hilt? For example, I have parameter, that I pass and I have
    val viewmodel: ViewModel = hiltViewModel()
    How do I pass a parameter from arguments to constructor?
    JulianK

    JulianK

    1 year ago
    You don't pass arguments to the hiltViewModel() function, instead, inject an instance of SavedStateHandle into your viewModel: https://developer.android.com/jetpack/compose/libraries#hilt You can than get your navigation arguments from there.
    Vsevolod Kaganovych

    Vsevolod Kaganovych

    1 year ago
    thank you!