faisalahmed
03/10/2023, 11:20 AMmutableStateListOf()
.
add and remove on the list triggers succesful recompositions of the specific item, but changing the value at any index of this list does not trigger any recomposition. Been scratching my head at this. My LazyColumn
is keyed to a unique id
coming in the data as well. So I am wondering what might be going wrong. Following is an example. Inside ViewModel
val list = mutableStateListOf<Messages>()
fun onMessageChanged(newMessage: Message) {
val index = list.indexOf(newMessage) // returns correct index
list[index] = newMessage // does not trigger recomposition
}
George Mulligan
03/10/2023, 3:25 PM