thelumiereguy
11/22/2022, 10:19 AMitem
in LazyColumn/LazyRow? I know that it helps with items
2. What’s the key
composable for? I saw a code snippet recently where people were wrapping the content with key
composable - inside an items
block. Is there a difference between wrapping with key
vs specifying the key in the items parameter itself.
3. Suppose that we’re sending a state object to a composable, but we’re not reading/getting the value. And now, if the state changes, would this cause a recomposition?ste
11/22/2022, 10:40 AMkey
parameter is not mandatory. If the content of the lazylist doesn't change (i.e. you don't add, move or remove items), you actually don't need it.
3. No, if you don't read it, it won't cause a recompositionthelumiereguy
11/22/2022, 10:45 AMitem
blocks and obviously an items
block. In this case, would it be better to add a static key to the item
block?
3. Understood!Hugo Bernardi
11/22/2022, 12:45 PM