Open hhyeok1026 opened 1 year ago
URL of codelab: https://developer.android.com/codelabs/basic-android-kotlin-compose-add-repository?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-compose-unit-5-pathway-2%3Fauthuser%3D1%26hl%3Dko%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-compose-add-repository#5
In which task and step of the codelab can this issue be found?
Describe the problem
In the codelab description The viewModel is created in MainActivity.
However,
MarsPhotosTheme { val viewModel: MarsViewModel = viewModel(factory = MarsViewModel.Factory) MarsPhotosApp(viewModel) }
MarsPhotosApp() is generating an error because there is no viewModel parameter.
In the solution code it is initializing marsViewModel inside the MarsPhotosApp composable function.
URL of codelab: https://developer.android.com/codelabs/basic-android-kotlin-compose-add-repository?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-compose-unit-5-pathway-2%3Fauthuser%3D1%26hl%3Dko%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-compose-add-repository#5
In which task and step of the codelab can this issue be found?
Describe the problem
In the codelab description The viewModel is created in MainActivity.
However,
MarsPhotosApp() is generating an error because there is no viewModel parameter.
In the solution code it is initializing marsViewModel inside the MarsPhotosApp composable function.