https://kotlinlang.org logo
#compose
Title
# compose
a

AmrJyniat

09/27/2022, 9:58 AM
Is there a way to update a property item(data class) inside a
mutableStateListOf
without creating a new list then assign it to the original
mutableStateListOf
?
z

Zaki Shaikh

09/27/2022, 10:12 AM
Hope this work stateList[index] = stateList [index].copy(x=y)
a

AmrJyniat

09/27/2022, 10:40 AM
Yah that's work perfectly, Thanks man
z

Zach Klippenstein (he/him) [MOD]

09/27/2022, 2:41 PM
In general, `SnapshotStateList`s can be modified in-place without having to create a new list - that’s their whole reason for existing.
77 Views