https://kotlinlang.org logo
n

Nikolas Guillen Leon

10/05/2022, 10:18 AM
I have a LazyColumn which show a MutableStateList of items: is it normal that when I update a single item in the list, all the visible items get recomposed? even though I they do not change in any way
s

ste

10/05/2022, 10:28 AM
Do you provide the
key
for each item?
n

Nikolas Guillen Leon

10/05/2022, 10:29 AM
yes
z

Zach Klippenstein (he/him) [MOD]

10/05/2022, 3:05 PM
I believe that is a known issue with lazy lists right now, yes.
n

Nikolas Guillen Leon

10/05/2022, 3:09 PM
oh ok, , thank you very much. I thought I was doing something wrong (and maybe I am anyway 😁)
z

Zach Klippenstein (he/him) [MOD]

10/05/2022, 5:09 PM
Within each list item, most of the composition should end up getting skipped if nothing has changed.
n

Nikolas Guillen Leon

10/05/2022, 5:20 PM
That's the problem: all items in the screen get recomposed. In my particular case, I'm updating a single field (quantity) in a single item in the list. Nevertheless, even though only one item has changed, even the others get recomposed. In particular, the composable holding the "quantity" value gets recomposed in every single item in the lazy column
39 Views