-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
I am not sure this adheres to the official recommendations, thus not making it very clean. As I understand, view model instances shouldn't be passed down to children components. Say, you have view model at GroupScreen
- this is where it should be - but it shouldn't be passed down to children views, such as AddGroupDialog
:
https://developer.android.com/topic/architecture/ui-layer/stateholders#viewmodel-as
Warning: Don't pass ViewModel instances down to other composable functions. Doing so couples the composable function with the ViewModel type, making it less reusable and harder to test and preview.
AddGroupDialog
should not be aware of the model. It can get states and some callbacks passed down from the page component.
itskahrbaa
Metadata
Metadata
Assignees
Labels
No labels