AJ
07/08/2020, 2:12 PMModelList
of objects (like a Story
object with a title and body). When updating an object in my ModelList
, my UI doesn't change. However, if I add an element to the list, or just re-assign the entire list after changes, then the UI updates. Is this behavior expected? What is the best way to manage changing objects within a list that are represented on a Jetpack Compose UI, like in a VerticalScroller or LazyColumnItems so that it actually updates?Adam Powell
07/08/2020, 2:20 PMmutableStateOf
if you would like compose to see those changesAdam Powell
07/08/2020, 2:20 PMAJ
07/08/2020, 2:22 PMmutableStateOf
Adam Powell
07/08/2020, 2:27 PMmyModelList[index] = object.copy(one = 1)
and that isn't causing recomposition, please file a bug as it should be seen as a structural changeAJ
07/08/2020, 3:42 PMcopy
to change an object at a list index did work to update the UI, thanks for the help.