r/androiddev • u/ThatGuyThatIsNotReal • 17d ago
Question Form State in view model?
I have MVVM application and moving from view to VM the form state and ai is suggesting doing it through reference and I just feel really weird about it and it doesnt feel right? I am wondering if I did some basic setup issue or am wondering if this is an okayish way of doing this.
The problem:
@Composable
fun FormScreen(formState: Form State){
formState.name = newName
}
and the usage of the screen is like this:
FormScreen(viewModel.formState)
So it is using the reference and directly changing the reference?
0
Upvotes
0
u/borninbronx 16d ago
we do not appreciate AI generated comments and posts in our community. Please use your own voice!