LazyColumn(
modifier = Modifier.fillMaxSize()
) {
... other items
item{} // i want to cache this item and it should not reloaded or recreated
}
m
McEna
12/26/2023, 9:04 PM
If content the item is based on does not change, and yu handle state properly, then the item will be cached automatically. Compose only renders objects when the state they depend on changes. So add a key to the items, and you'll get caching behavior.
m
myanmarking
12/28/2023, 11:08 AM
yes. you can use PinnableContainer API to 'cache' composables