https://kotlinlang.org logo
Title
p

Peter Mandeljc

05/23/2022, 5:39 PM
What happens, when you don't use "key" in "LazyColumn"? Will the hash of the item be used instead?
f

Filip Wiesner

05/23/2022, 5:43 PM
As per the documentation:
If null is passed the position in the list will represent the key.
👍 2
j

Ji Sungbin

05/23/2022, 5:44 PM
default key value is null.
👆 3
If the key is entered as null, the instance is reused according to the order of each item. For example, if E is added last in A, B, C, D, the previous instance is reused because the order of A, B, C, D is the same. However, if an item is added in the center, the order of C, D is changed so a new instance is allocated.
If a key is provided, the instance is reused even if the order is changed because the key itself caches the item.
p

Peter Mandeljc

05/23/2022, 7:16 PM
Thanks for info!
:blob-hug: 1